mekdonel Posted July 18, 2007 Share Posted July 18, 2007 I called a query from database which will display a line of string e.g id1id2id3id4.... How do i detect if the string contain the word 'id4' for example. I'm using PHP 4.3.10 Thanks in advance Link to comment https://forums.phpfreaks.com/topic/60533-solved-detect-word-from-a-string/ Share on other sites More sharing options...
metrostars Posted July 18, 2007 Share Posted July 18, 2007 if(strpos("$string", 'id4')) {echo "The line contains id4";} else {echo "The line doesn't contain id4";} Link to comment https://forums.phpfreaks.com/topic/60533-solved-detect-word-from-a-string/#findComment-301118 Share on other sites More sharing options...
mekdonel Posted July 18, 2007 Author Share Posted July 18, 2007 Thanks for the fast reply. Problem solved Link to comment https://forums.phpfreaks.com/topic/60533-solved-detect-word-from-a-string/#findComment-301121 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.