pouncer Posted April 2, 2007 Share Posted April 2, 2007 How can I find one string inside another. i'm looking to do something like if str("my sentence here", "sent") { do something } Quote Link to comment Share on other sites More sharing options...
franzy_pan Posted April 2, 2007 Share Posted April 2, 2007 hi, As far as i'm aware this can be done with something like the following: if (strstr($the_string_your_searching, "the_item_searching_for")) { } Not too dissimilar from your original code. Hope it helps. Quote Link to comment Share on other sites More sharing options...
obsidian Posted April 2, 2007 Share Posted April 2, 2007 Depending on how specific the match is, strstr(), preg_match() or even ereg() could do what you're after. 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.