Skip to content

Instantly share code, notes, and snippets.

@Jules59
Last active March 10, 2018 13:38
Show Gist options
  • Save Jules59/281598eedac54160d72255d08e819dd7 to your computer and use it in GitHub Desktop.
Save Jules59/281598eedac54160d72255d08e819dd7 to your computer and use it in GitHub Desktop.
array for Indiana Jones
<?php
//first Solution
$movieindy = array("Les Aventuriers de l'Arche Perdu" => 'Harrison Ford , Paul Freeman , Karen Allen' , "Indiana Jones et le Temple Maudit" => 'Harrison Ford , Kate Capshaw , Jonathan Ke Quan' , "Indiana Jones et la Diernières Croisade" => 'Harrison Ford , Sean Connery, Denholm Elliott');
foreach($movieindy as $key => $value) {
echo "Dans $key les acteurs principaux sont: $value. <br>";
}
echo"<br>";
//Or Second Solution
$movie["Les Aventuriers de l'Arche Perdu"] = 'Indiana Jones , Paul Freeman , Karen Allen';
$movie["Indiana Jones et le Temple Maudit"] = 'Indiana Jones , Kate Capshaw , Jonathan Ke Quan';
$movie["Indiana Jones et la Dernière Croisade"] = 'Indiana Jones , Sean Connery , Denholm Elliott';
foreach($movie as $key => $value) {
echo "Dans $key les acteurs principaux sont: $value. <br>";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment