AbydosGater Posted October 15, 2007 Share Posted October 15, 2007 Hey guys, Sorry for the silly question.. Been awhile.. If i have one string .. how do i go about searching it to see if it contains another string? Thanks, Andy Quote Link to comment https://forums.phpfreaks.com/topic/73361-finding-a-string-inside-another/ Share on other sites More sharing options...
wildteen88 Posted October 15, 2007 Share Posted October 15, 2007 use substr prehaps? or preg_match for more search power Quote Link to comment https://forums.phpfreaks.com/topic/73361-finding-a-string-inside-another/#findComment-370129 Share on other sites More sharing options...
darkfreaks Posted October 15, 2007 Share Posted October 15, 2007 substr would just return part of the string if you want to search a string for another string you might want to combine strpos and substr. Quote Link to comment https://forums.phpfreaks.com/topic/73361-finding-a-string-inside-another/#findComment-370130 Share on other sites More sharing options...
kenrbnsn Posted October 15, 2007 Share Posted October 15, 2007 I would use either strpos() or strstr() Ken Quote Link to comment https://forums.phpfreaks.com/topic/73361-finding-a-string-inside-another/#findComment-370134 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.