3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array ( 0 => array ( 0 => 'ABC', 1 => 'XYZ' ), 1 => array ( 1 => 'ADW', 20 => 'XYZ', 26 => 'AA2', 30 => 'PQR', 60 => 'WWW', 701 => 'ZZZ' ) ); $result = array(); foreach ($data as $rownum => $row) { foreach ($row as $colnum => $value) { if ($colnum >= 26) { $col0 = $colnum % 26; $col1 = intdiv($colnum, 26); $colstr = chr(64 + $col1) . chr(65 + $col0); } else { $colstr = chr(65+$colnum); } $result[$colstr . ($rownum+1)] = $value; } } print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [A1] => ABC [B1] => XYZ [B2] => ADW [U2] => XYZ [AA2] => AA2 [AE2] => PQR [BI2] => WWW [ZZ2] => ZZZ )

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