3v4l.org

run code in 300+ PHP versions simultaneously
<?php $labels = [ ["EY>Yes","Media Type>Category B","Coverage Type>Quote","Industry Programs>Communications","Score>1"], ["EY>No","Media Type>Category B2","Coverage Type>Quote2","Industry Programs>Communications2","Score>2"], ]; $i = 0; foreach($labels[0] as $ind=>$label){ $letter = range('A', 'Z')[$ind]; $tmp = explode('>',$label); $col_names[] = $tmp[0]; echo $letter.'1'."\r\n"; //$objPHPExcel->getActiveSheet()->setCellValue($letter.'1',$tmp[0]); echo "Column -> $tmp[0] \r\n"; } echo "\r\n\r\n"; // print_r($col_names); // column names /* ( [0] => EY [1] => Media Type [2] => Coverage Type [3] => Industry Programs [4] => Score ) */ foreach ($labels as $ind=>$item){ $index = $ind + 2; foreach($item as $ind2=>$data){ $letter = range('A', 'Z')[$ind2]; echo "$letter$index \r\n"; $val = explode('>',$data); //$objPHPExcel->getActiveSheet()->setCellValue("$letter$index",$val[1]); echo "Value at $index -> $val[1] \r\n\r\n"; } echo "\r\n\r\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
A1 Column -> EY B1 Column -> Media Type C1 Column -> Coverage Type D1 Column -> Industry Programs E1 Column -> Score A2 Value at 2 -> Yes B2 Value at 2 -> Category B C2 Value at 2 -> Quote D2 Value at 2 -> Communications E2 Value at 2 -> 1 A3 Value at 3 -> No B3 Value at 3 -> Category B2 C3 Value at 3 -> Quote2 D3 Value at 3 -> Communications2 E3 Value at 3 -> 2

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:
28.91 ms | 406 KiB | 5 Q