PHP: The Switch Statement and Arrays - Printing the Array Values (
Page 3 of 6 )
If we wanted to print the values inside of the array, we could do so this way:
<html>
<body>
<?php
$mygirlfriends[0] = “Your Mother”;
$mygirlfriends[1] = “Angelina Jolie”;
$mygirlfriends[2] = “Whitney White”;
echo $mygirlfriends[1] . “and” . $names[2]
}
?>
The above code would print:
Angelina Jolie and Whitney White