3v4l.org

run code in 300+ PHP versions simultaneously
<?php $month = [ 'January', 'January', 'January', 'January', 'February' ]; $weeks = [ 'Week 1', 'Week 2', 'Week 3', 'Week 4', 'Week 1' ]; $newArray = []; foreach ($month as $index => $value) { // Create the new string you want, using the same index for both arrays $newArray[] = $value . ' - ' . $weeks[$index]; } print_r($newArray);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => January - Week 1 [1] => January - Week 2 [2] => January - Week 3 [3] => January - Week 4 [4] => February - Week 1 )

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:
104.2 ms | 405 KiB | 5 Q