snake310 Posted January 11, 2007 Share Posted January 11, 2007 example:$phrase="This is what i want";I want to get out the words from the phrase one by one like:$word1="This";$word2="is";and so on..any idea any1? Link to comment https://forums.phpfreaks.com/topic/33716-break-up-string/ Share on other sites More sharing options...
play_ Posted January 11, 2007 Share Posted January 11, 2007 <?php$phrase="This is what i want";$array_of_words = explode(' ', $phrase);echo $array_of_words[0]; // this will give you 'This'echo $array_of_words[1]; // this will give you 'is'echo $array_of_words[2]; // this will give you 'what'?> Link to comment https://forums.phpfreaks.com/topic/33716-break-up-string/#findComment-158092 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.