<?php
$dogs = [
['breed' => 'Cocker Spaniel', 'name' => ' Jypsy', 'size' => [
'width'=> 5,
'height'=> 10]],
['breed' => 'german ', 'name' => ' Jypsy', 'size' => [
'width'=>5,
'height'=> 10]],
['breed' => 'Shiba Inu', 'name' => ' Kotetsu', 'size' => [
'width'=> 5,
'height'=> 10]],
['breed' => 'Unknown', 'name' => ' Sheru ', 'size' => [
'width'=>5,
'height'=> 10]],
];
foreach($dogs as $key=>$item){
print_r $key . "= " . $item;
}
//echo '<div>' . $dogs[0]['name'] . '</div>';
?>
- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
- Parse error: syntax error, unexpected '$key' (T_VARIABLE) in /in/tFlQs on line 17
Process exited with code 255.
preferences:
170.93 ms | 1395 KiB | 36 Q