Skip to content

Instantly share code, notes, and snippets.

@stephanBerger
Created October 17, 2019 09:02
Show Gist options
  • Save stephanBerger/9722b94a1447d7f8f7c23f709207d179 to your computer and use it in GitHub Desktop.
Save stephanBerger/9722b94a1447d7f8f7c23f709207d179 to your computer and use it in GitHub Desktop.
4. Les tableaux && boucles en PHP
<?php
$indianaMovies = [
"Indiana Jones and the Kingdom of the Crystal Skul" => [
"Harrison Ford",
"Cate Blanchette",
"Karen Allen"],
"Indiana Jones and the Last Crusade" => [
"Harrison Ford",
"Sean Connery",
"Denholm Elliott"],
"Indiana Jones and the Temple of Doom"=> [
"Harrison Ford",
"Kate Capshaw",
"Jonathan Ke Quan"],
];
foreach ($indianaMovies as $movieTitle => $actors){
echo "Dans le film " . $movieTitle . ", les principaux acteurs sont : ".implode(", ",$actors).".\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment