3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = "The quick brown fox jumps over the lazy dog"; $arr = explode(" ",$value); $str_arr = array(); $str = $arr[0]; $char_limit = 36; foreach($arr as $key=>$value) { $tmp_str = isset($arr[$key + 1])?$arr[$key + 1]:""; if(strlen($str." ".$tmp_str) <= $char_limit) { $str.=" ".$tmp_str; } else { $str_arr[]=$str; $str=$tmp_str; } } $str_arr[]=$str; print_r ($str_arr);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => The quick brown fox jumps over the [1] => lazy dog )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
41.28 ms | 1468 KiB | 4 Q