i'd use preg_replace or ereg replace, turn paragraph of phrases such 1 below:
this 1 2 3 4 to list, such 1 below:
notice i'm targeting spaces before upper case letters.
$word = "this 1 2 3 four"; $arr = explode (" " , $word); $lines = array_chunk($arr,3); foreach($lines $line) echo implode (" ", $line)."<br>";
Comments
Post a Comment