www.webdeveloper.com
Results 1 to 4 of 4

Thread: help with stripos

  1. #1
    Join Date
    Nov 2010
    Posts
    54

    help with stripos

    Hi I'm trying to search for a string using php with an @ symbol in it.
    eg if some writes @lilfellabob then echo "@lilfellabob was found" else echo "@lilfellabob was not found".
    Should be simple but something with the @ symbol is making it not work and I feel like stabbing someone.

    if (stripos($message, "'@'lilfellabob"))
    {
    echo "@lilfellabob was found";
    }

    Any idea what I can do to make the @ symbol work (if i take it away and search "lilfellabob" it works perfectly)

    cheers,

    lilfellabob

  2. #2
    Join Date
    Nov 2010
    Posts
    54
    oh i didn't have all those quotation marks before, was just trying things :P

    I had:

    if (stripos($message, "@lilfellabob"))
    {
    echo "@lilfellabob was found";
    }

  3. #3
    Join Date
    Aug 2009
    Posts
    593
    I would recommend doing it this way...

    PHP Code:
    if (stripos($message'@lilfellabob') !== false)
    {
        echo 
    '@lilfellabob was found';


  4. #4
    Join Date
    Nov 2010
    Posts
    54
    worked a treat, thanks a million

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles