godsent Posted February 6, 2009 Share Posted February 6, 2009 For example string is $a = "one:two:three:four:five"; Is where's any way to obtain every word between ":"? To segment string in to these 5 words. Help me if you know Link to comment https://forums.phpfreaks.com/topic/144061-string-analysis/ Share on other sites More sharing options...
JonnoTheDev Posted February 6, 2009 Share Posted February 6, 2009 Easy $words = explode(":",$a); print_r($words); You can then loop through the$words array Link to comment https://forums.phpfreaks.com/topic/144061-string-analysis/#findComment-755893 Share on other sites More sharing options...
Mark Baker Posted February 6, 2009 Share Posted February 6, 2009 Or $string = "one:two:three:four:five"; $words = str_word_count($string,2); print_r($words); Link to comment https://forums.phpfreaks.com/topic/144061-string-analysis/#findComment-755894 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.