3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array("FIRST_NAME" => "Jon", "LAST_NAME" => "Doe"), array("FIRST_NAME" => "Jane", "LAST_NAME" => "Doe"), array("FIRST_NAME" => "Johnny", "LAST_NAME" => "Doe"), array("FIRST_NAME" => "Janie", "LAST_NAME" => "Doe")); $output = ""; foreach ($array as $i => $values) { // get the arrays in the outer array if ($i != 0) { // check if it is not the first element $output .= ", {$values['FIRST_NAME']} {$values['LAST_NAME']}"; } else { $output .= "{$values['FIRST_NAME']} {$values['LAST_NAME']}"; } } echo $output;

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
222.44 ms | 2065 KiB | 8 Q