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 Quote Link to comment 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";} Quote Link to comment 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 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.