3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $chkBoxID = '1,2'; $chkBoxEmails = 'email1@test.com,email1@test2.com'; $orders = implode(",", $chkBoxID); $emails = implode(",", $chkBoxEmails); $combined = array_chunk( array_merge( $orders, $emails ), count($orders) ); var_dump($combined);
based on Ktejp
Output for 7.2.0
Warning: implode(): Invalid arguments passed in /in/ZQBlu on line 6 Warning: implode(): Invalid arguments passed in /in/ZQBlu on line 7 Warning: array_merge(): Argument #1 is not an array in /in/ZQBlu on line 12 Warning: count(): Parameter must be an array or an object that implements Countable in /in/ZQBlu on line 14 Warning: array_chunk() expects parameter 1 to be array, null given in /in/ZQBlu on line 14 NULL
Output for 7.0.20, 7.1.5 - 7.1.10
Warning: implode(): Invalid arguments passed in /in/ZQBlu on line 6 Warning: implode(): Invalid arguments passed in /in/ZQBlu on line 7 Warning: array_merge(): Argument #1 is not an array in /in/ZQBlu on line 12 Warning: array_chunk() expects parameter 1 to be array, null given in /in/ZQBlu on line 14 NULL
Output for 7.0.0 - 7.0.6, 7.1.0
Warning: implode(): Invalid arguments passed in /in/ZQBlu on line 6 Warning: implode(): Invalid arguments passed in /in/ZQBlu on line 7 Warning: array_merge(): Argument #1 is not an array in /in/ZQBlu on line 9 Warning: array_chunk() expects parameter 1 to be array, null given in /in/ZQBlu on line 9 NULL
Output for 5.3.19 - 5.6.28
Warning: implode(): Invalid arguments passed in /in/ZQBlu on line 6 Warning: implode(): Invalid arguments passed in /in/ZQBlu on line 7 Warning: array_merge(): Argument #1 is not an array in /in/ZQBlu on line 13 Warning: array_chunk() expects parameter 1 to be array, null given in /in/ZQBlu on line 15 NULL