Kingy Posted January 21, 2008 Share Posted January 21, 2008 What i really want is something like <?php $string = "hi "; if(preg_match("', $string)) { echo "Found Smiley"; } else { echo "Smiley not Found"; } ?> i no that the preg_match function above is wrong, how would i go about doing something like this properly? Quote Link to comment Share on other sites More sharing options...
teng84 Posted January 21, 2008 Share Posted January 21, 2008 if(stristr(" hi ",'')){ echo 'found smily'; }else{ echo 'found nothTENG'; } string are better Quote Link to comment Share on other sites More sharing options...
Mirkules Posted January 21, 2008 Share Posted January 21, 2008 <?php $string = "hi "; if(preg_match('/:\)/', $string)) { echo "Found Smiley"; } else { echo "Smiley not Found"; } ?> http://us2.php.net/preg_match Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.