adam291086 Posted August 20, 2008 Share Posted August 20, 2008 I have a variable with over a 100 characters in it. Is there a quick way to say if($bigvariable contains 'adam') { echo 'good' } Link to comment https://forums.phpfreaks.com/topic/120519-solved-if-a-variable-contains-a-certian-word/ Share on other sites More sharing options...
Fadion Posted August 20, 2008 Share Posted August 20, 2008 Try this: <?php $str = 'some long text wich contains adam and some other words'; if(strstr($str, 'adam')){ echo 'found'; } ?> Link to comment https://forums.phpfreaks.com/topic/120519-solved-if-a-variable-contains-a-certian-word/#findComment-621047 Share on other sites More sharing options...
adam291086 Posted August 20, 2008 Author Share Posted August 20, 2008 thanks Link to comment https://forums.phpfreaks.com/topic/120519-solved-if-a-variable-contains-a-certian-word/#findComment-621052 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.