Using PHP create an associative array that holds 10 movie ti
Using PHP, create an associative array that holds 10 movie titles and print the array using a foreach statement.
Solution
<?php
$movies = array(\"1\"=>\"batman\", \"2\"=>\"Spiderman\",\"3\"=>\"superman\", \"4\"=>\"Catch me if you can\",\"5\"=>\"The notebook\", \"6\"=>\"The Budapest hotel\",\"7\"=>\"Pulp fiction\", \"8\"=>\"Harry potter\",\"9\"=>\"The terminal\", \"10\"=>\"The great debaters\");
foreach ($movies as $value) {
echo \"$value <br>\";
}
?>
