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? Link to comment https://forums.phpfreaks.com/topic/86974-preg_match/ 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 Link to comment https://forums.phpfreaks.com/topic/86974-preg_match/#findComment-444718 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 Link to comment https://forums.phpfreaks.com/topic/86974-preg_match/#findComment-444721 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.