Last active
October 15, 2018 12:39
-
-
Save pierrealexaline/b0348e1cf2874dd751e918607e0c1308 to your computer and use it in GitHub Desktop.
exercice php array 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $indiana_films[] = array( 'Raiders of the Lost Ark2','Harrison Ford','Karen Allen','Paul Freeman'); | |
| $indiana_films[] = array( 'Indiana Jones and the Temple of Doom','Harrison Ford','Kate Capshaw','Amrish Puri'); | |
| $indiana_films[] = array( 'Indiana Jones and the Last Crusade','Harrison Ford','Sean Connery','Denholm Elliott'); | |
| //print_r( $array['indiana'] ); | |
| $o = ''; | |
| foreach($indiana_films as $key=>$value) | |
| { | |
| $o .= '<div>'; | |
| $o .= 'Dans le film : <strong>'."\n"; | |
| $o .= $value[0]."</strong><br>\n"; | |
| $o .= " les principaux acteurs sont : \n"; | |
| $o .= "<ul>"; | |
| $o .= '<li>'.$value[1]."</li>\n"; | |
| $o .= '<li>'.$value[2]."</li>\n"; | |
| $o .= '<li>'.$value[3]."</li>\n"; | |
| $o .= "</ul>"; | |
| $o .= '</div>'; | |
| } | |
| echo $o; | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment