3v4l.org

run code in 300+ PHP versions simultaneously
<?php $parent = [ 0 => "num", 1 => "No", 2 => "Name", 3 => "Phone", 4 => "Price", 5 => "Date", ]; $child = [ 0 => [ "No" => "FR201605832", "Price" => 199.0, "Date" => "2016-09-01", "num" => "19", "Name" => "Tom", "Phone" => "0900123456", ], 1 => [ "No" => "EC2016010100001", "Price" => 1680.0, "Date" => "2016-09-01", "num" => "1680", "Name" => "Ted", "Phone" => "0900321654", ] ]; $modified = []; foreach($parent as $i => $val) { foreach($child as $ci => $data) { $modified[$ci][$val] = $data[$val]; } } echo "<pre>";print_r($modified);
Output for git.master_jit, git.master, rfc.property-hooks
<pre>Array ( [0] => Array ( [num] => 19 [No] => FR201605832 [Name] => Tom [Phone] => 0900123456 [Price] => 199 [Date] => 2016-09-01 ) [1] => Array ( [num] => 1680 [No] => EC2016010100001 [Name] => Ted [Phone] => 0900321654 [Price] => 1680 [Date] => 2016-09-01 ) )

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:
46.38 ms | 410 KiB | 6 Q