1 2 3 4 5 6 7 8 9 10 11 12
<?php $str = "hey hello man are you going to write some code"; $strarray = explode(' ', $str); $new_str = ''; foreach($strarray as $word){ if(strlen($word) >= 4) $new_str .= ' '.$word; } echo $new_str; ?>
1
hello going write some code