3v4l.org

run code in 300+ PHP versions simultaneously
<?php $info = array( array('catogary' => '麵包紙杯', 'typeA' => 'DPK219', 'typeB' => 'VAC001', 'price' => '1.00'), array('catogary' => '麵包紙杯', 'typeA' => 'DPK219', 'typeB' => 'VBW001', 'price' => '1.00'), array('catogary' => '罐裝蟹肉 ', 'typeA' => 'RCN061-1', 'typeB' => 'VAC001', 'price' => '2.00'), array('catogary' => '罐裝蟹肉 ', 'typeA' => 'RCN061-1', 'typeB' => 'VBW001', 'price' => '2.00'), array('catogary' => '牛淋片5mm', 'typeA' => 'RFB300-2', 'typeB' => 'VAC001', 'price' => '3.00'), array('catogary' => '牛淋片5mm', 'typeA' => 'RFB300-2', 'typeB' => 'VBW001', 'price' => '3.00'), array('catogary' => '厚牛淋片', 'typeA' => 'RFB300-3', 'typeB' => 'VAC001', 'price' => '4.00'), array('catogary' => '厚牛淋片', 'typeA' => 'RFB300-3', 'typeB' => 'VBW001', 'price' => '4.00'), ); $tableInfo = array(); // $tableInfo = array_column($info, 'catogary', 'price');//if php version > 5.5 foreach($info as $item) $tableInfo[$item['catogary']] = $item['price']; ?> <table> <?php foreach($tableInfo as $catogary => $price) { ?> <tr> <td><?=$catogary?></td> <td><?=$price?></td> <td><?=$price?></td> </tr> </tbale> <?php }
Output for git.master, git.master_jit, rfc.property-hooks
<table> <tr> <td>麵包紙杯</td> <td>1.00</td> <td>1.00</td> </tr> </tbale> <tr> <td>罐裝蟹肉 </td> <td>2.00</td> <td>2.00</td> </tr> </tbale> <tr> <td>牛淋片5mm</td> <td>3.00</td> <td>3.00</td> </tr> </tbale> <tr> <td>厚牛淋片</td> <td>4.00</td> <td>4.00</td> </tr> </tbale>

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:
42.58 ms | 402 KiB | 8 Q