Define and use multidimensional arrays.
Source Code
$contacts = [
['name' => 'John Doe', 'email' => '[email protected]'],
['name' => 'Jane Doe', 'email' => '[email protected]']
];
echo $contacts[0]['name']; // Outputs: John Doe
Define and use multidimensional arrays.
$contacts = [
['name' => 'John Doe', 'email' => '[email protected]'],
['name' => 'Jane Doe', 'email' => '[email protected]']
];
echo $contacts[0]['name']; // Outputs: John Doe