Hello friends I am a beginner in php language, I need to do the following: Create an arrangement with movies and its leading actor. In ANOTHER arrangement to put the movies and their release year. Taking data from both arrangements, show each movie with its leading actor and its premiere year. Example:
Rapidos y Furiosos 8 -- actor: Vin disel -- Estreno: 2017
Star Trek: Into Darkness -- actor: Chris pine -- Estreno: 2013
Los vengadores 3 -- actor: Robert Downey Jr. -- Estreno: 2018
I put it this way but it shows it 9 times. Thanks for your help.
<?php
$arreglo1 = array('Rapido y Furioso 8'=>'actor: Vin Disel' , 'Star Trek: Into Darkness'=>'actor: Chris Pine' ,
'Los Vengadores 3'=>'actor: Robert Downey Jr.');
$arreglo2 = array('Rapido y Furioso 8'=>'Estreno: 2017' , 'Star Trek: Into Darkness'=>'Estreno: 2013' ,
'Los Vengadores 3'=>'Estreno: 2018');
foreach ($arreglo1 as $pelicula => $actor) {
foreach ($arreglo2 as $pelicula => $estreno) {
echo($pelicula." --- ".$actor." --- ".$estreno."<br>");
}
}
?>