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
12-13-2010, 08:45 AM
lilfellabob
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";
}
12-13-2010, 09:03 AM
thraddash
I would recommend doing it this way...
PHP Code:
if (stripos($message, '@lilfellabob') !== false)
{
echo '@lilfellabob was found';
}