3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //$Input = [0,{"a":1,"b":2,"c":3,"d":[4,5]},[6,[7,8]],9,10]; <- isnt valid PHP. $Input = '[0,{"a":1,"b":2,"c":3,"d":[4,5]},[6,[7,8]],9,10]'; $myArray = explode(',', $Input ); //print_r($myArray); //$length = strlen($Input); foreach($myArray as $my_Array){ echo $my_Array.'<br>'; } $Output = '[1,{"a":2,"b":3,"c":4,"d":[5,6]},[7,[8,9]],10,11]'; ?>
based on 4gG7J
Output for 4.3.0 - 5.6.30, hhvm-3.10.1 - 3.22.0, 7.0.0 - 7.2.6
[0<br>{"a":1<br>"b":2<br>"c":3<br>"d":[4<br>5]}<br>[6<br>[7<br>8]]<br>9<br>10]<br>