From 0d5cf3b46e713543573e5748ed66840d9915b391 Mon Sep 17 00:00:00 2001 From: adora84 Date: Wed, 15 Jun 2016 15:45:14 +0200 Subject: [PATCH] adora-film --- Montreuil-Promo-5/adora-film.php | 89 ++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Montreuil-Promo-5/adora-film.php diff --git a/Montreuil-Promo-5/adora-film.php b/Montreuil-Promo-5/adora-film.php new file mode 100644 index 0000000..73bdaec --- /dev/null +++ b/Montreuil-Promo-5/adora-film.php @@ -0,0 +1,89 @@ + + + +

List of films

+ +"; +$x=0; +$y=1; + +echo "The top 10 films are:
"; +while ($x<10) +{ + $z=$top[$x]["title"]["label"]; + echo "$y $z
"; +$x++; +$y++; +} +echo "-------------------------------------
" ; +$a=0; +while ($a<=$array) +{ + $k=$top[$a]["title"]["label"]; +if (strstr($k,"Gravity")) + { + echo "The ranking of the movie “Gravity” is : " ; + echo "$a
"; + } +$a++; +} +echo "-------------------------------------
" ; +$h=0; +while ($h<=$array) +{ + $p=$top[$h]["title"]["label"]; + if (strstr($p,"The LEGO Movie")) + { + $p=$top[$h]["im:artist"]["label"]; + echo "The director of “The LEGO Movie” is : " ; + echo "$p
"; + } + +$h++; +} +echo "-------------------------------------
" ; +$v=0; +$w=0; +while ($v<=$array) +{ + $m=$top[$v]["im:releaseDate"]["attributes"]["label"]; + + $f=substr($m, -4); + if ($f<2000) + { + $w++; + } + +$v++; +} +echo "The films were released before 2000 are : " ; + echo "$w
"; +echo "-------------------------------------
" ; +$ll=0; +$ff=1; +while ($ll<=$array) + { + while ($ff<=$array) + { + $n=$top[$ll]["im:releaseDate"]["attributes"]["label"]; + $oldest_film=substr($n, -4); + $KK=$top[$ff]["im:releaseDate"]["attributes"]["label"]; + $oldest_film2=substr($KK, -4); + if ($oldest_film<$oldest_film2) + { + $ff++; + } + else { $oldest_film = $oldest_film2; } + } +$ll++; +echo "$oldest_film
"; +} + +?> + +