3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mbStringToArray ($string) { $strlen = mb_strlen($string); while ($strlen) { $array[] = mb_substr($string,0,1,"UTF-8"); $string = mb_substr($string,1,$strlen,"UTF-8"); $strlen = mb_strlen($string); } return $array;}function joinsigns($array){ $singsArray=array("ि","्"); $out=array($array[0]); for ($i=1; $i <count($array) ; $i++) { if (in_array($array[$i], $singsArray)) { $out[count($out)-1].=$array[$i]; }else{ $out[]=$array[$i]; } } return $out;}$a = "मायने";$ar=mbStringToArray($a);print_r($ar);echo "<br>";print_r(joinsigns($ar));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => म [1] => ा [2] => य [3] => न [4] => े ) <br>Array ( [0] => म [1] => ा [2] => य [3] => न [4] => े )

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:
48.46 ms | 401 KiB | 8 Q