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 } Link to comment https://forums.phpfreaks.com/topic/45258-string-manipulation/ 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. Link to comment https://forums.phpfreaks.com/topic/45258-string-manipulation/#findComment-219729 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. Link to comment https://forums.phpfreaks.com/topic/45258-string-manipulation/#findComment-219755 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.