3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = [ [ 'Standort' => '', 'Letzte Meldung' => '', 'On-/Offline seit' => '04.05.2022 11:03', 'Online' => '', ], [ 'Standort' => 'Schweiz', 'Letzte Meldung' => '', 'On-/Offline seit' => '11.02.2022 14:59', 'Online' => '', ] ]; $columns = []; foreach ($input[0] as $columnName => $value) { $columnData = array_column($input, $columnName); if (strlen(implode($columnData))) { $columns[$columnName] = $columnData; } } $result = []; foreach ($columns as $colName => $colValues) { foreach ($colValues as $i => $value) { $result[$i][$colName] = $value; } } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => array ( 'Standort' => '', 'On-/Offline seit' => '04.05.2022 11:03', ), 1 => array ( 'Standort' => 'Schweiz', 'On-/Offline seit' => '11.02.2022 14:59', ), )

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