3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $s = "id=&action=save&title=Corporate+Identity&short=identity&colour=%23ff751a&categoryID=1&bookURL=%2Ffiles%2Fbooks%2Fart_of_corporate_identity.pdf&bookImage=%2Ffiles%2Fimages%2Farticle-thumbs%2Fidentity.png&intro=%3Cp%3E%3Cbr+data-mce-bogus%3D%221%22%3E%3C%2Fp%3E&section%5B%5D%5Btitle%5D=Your+current+identity&section%5B%5D%5Bquestion%5D%5B%5D%5Btype%5D=5&section%5B%5D%5Bquestion%5D%5B%5D%5Btext%5D=What's+going+on+here%3F&section%5B%5D%5Bquestion%5D%5B%5D%5Boption%5D%5B%5D=This+is+option+1&section%5B%5D%5Bquestion%5D%5B%5D%5Boption%5D%5B%5D=Option+2!&section%5B%5D%5Bquestion%5D%5B%5D%5Boption%5D%5B%5D=And+number+3!&section%5B%5D%5Bquestion%5D%5B%5D%5Btype%5D=1&section%5B%5D%5Bquestion%5D%5B%5D%5Btext%5D=Hi&section%5B%5D%5Bquestion%5D%5B%5D%5Btype%5D=1&section%5B%5D%5Bquestion%5D%5B%5D%5Btext%5D=Hello&section%5B%5D%5Btitle%5D=Identity+management&section%5B%5D%5Btitle%5D=Brand+building&section%5B%5D%5Btitle%5D=Recognition&section%5B%5D%5Btitle%5D=Your+views+on+change&section%5B%5D%5Btitle%5D=Developing+a+new+identity"; echo var_dump(array_chunk(preg_split('/[&=]/', $s), 2));
Output for 4.3.0 - 7.1.0
array(24) { [0]=> array(2) { [0]=> string(2) "id" [1]=> string(0) "" } [1]=> array(2) { [0]=> string(6) "action" [1]=> string(4) "save" } [2]=> array(2) { [0]=> string(5) "title" [1]=> string(18) "Corporate+Identity" } [3]=> array(2) { [0]=> string(5) "short" [1]=> string(8) "identity" } [4]=> array(2) { [0]=> string(6) "colour" [1]=> string(9) "%23ff751a" } [5]=> array(2) { [0]=> string(10) "categoryID" [1]=> string(1) "1" } [6]=> array(2) { [0]=> string(7) "bookURL" [1]=> string(48) "%2Ffiles%2Fbooks%2Fart_of_corporate_identity.pdf" } [7]=> array(2) { [0]=> string(9) "bookImage" [1]=> string(49) "%2Ffiles%2Fimages%2Farticle-thumbs%2Fidentity.png" } [8]=> array(2) { [0]=> string(5) "intro" [1]=> string(50) "%3Cp%3E%3Cbr+data-mce-bogus%3D%221%22%3E%3C%2Fp%3E" } [9]=> array(2) { [0]=> string(24) "section%5B%5D%5Btitle%5D" [1]=> string(21) "Your+current+identity" } [10]=> array(2) { [0]=> string(43) "section%5B%5D%5Bquestion%5D%5B%5D%5Btype%5D" [1]=> string(1) "5" } [11]=> array(2) { [0]=> string(43) "section%5B%5D%5Bquestion%5D%5B%5D%5Btext%5D" [1]=> string(23) "What's+going+on+here%3F" } [12]=> array(2) { [0]=> string(51) "section%5B%5D%5Bquestion%5D%5B%5D%5Boption%5D%5B%5D" [1]=> string(16) "This+is+option+1" } [13]=> array(2) { [0]=> string(51) "section%5B%5D%5Bquestion%5D%5B%5D%5Boption%5D%5B%5D" [1]=> string(9) "Option+2!" } [14]=> array(2) { [0]=> string(51) "section%5B%5D%5Bquestion%5D%5B%5D%5Boption%5D%5B%5D" [1]=> string(13) "And+number+3!" } [15]=> array(2) { [0]=> string(43) "section%5B%5D%5Bquestion%5D%5B%5D%5Btype%5D" [1]=> string(1) "1" } [16]=> array(2) { [0]=> string(43) "section%5B%5D%5Bquestion%5D%5B%5D%5Btext%5D" [1]=> string(2) "Hi" } [17]=> array(2) { [0]=> string(43) "section%5B%5D%5Bquestion%5D%5B%5D%5Btype%5D" [1]=> string(1) "1" } [18]=> array(2) { [0]=> string(43) "section%5B%5D%5Bquestion%5D%5B%5D%5Btext%5D" [1]=> string(5) "Hello" } [19]=> array(2) { [0]=> string(24) "section%5B%5D%5Btitle%5D" [1]=> string(19) "Identity+management" } [20]=> array(2) { [0]=> string(24) "section%5B%5D%5Btitle%5D" [1]=> string(14) "Brand+building" } [21]=> array(2) { [0]=> string(24) "section%5B%5D%5Btitle%5D" [1]=> string(11) "Recognition" } [22]=> array(2) { [0]=> string(24) "section%5B%5D%5Btitle%5D" [1]=> string(20) "Your+views+on+change" } [23]=> array(2) { [0]=> string(24) "section%5B%5D%5Btitle%5D" [1]=> string(25) "Developing+a+new+identity" } }