Menu
support@authoritypapers.com
+1(805) 568 7317

i m trying to run a code using php and json but i am getting awarning of an invalid 5121828

I’m trying to run a code using php and json but I am getting awarning of an invalid argument. Please help movies.php

$jsondata = file_get_contents(“movies.json”);

$json = json_decode($jsondata. true);

$output = “

    ”;

    foreach($json[‘movies’] as $movie){

          $output.=”

    ”.$movie[‘title’].”

    ”;

          $output.=”

  • Year:”.$movie[‘year’].”
  • ”;

          $output.=”

  • Genre:”.$movie[‘genre’].”
  • ”;

          $output.=”

  • Director:”.$movie[‘director’].”
  • ”;

    }

    $output .=”

”;

echo $output;

?> movies.json { “movies”: [

{

   “title”: “The Notebook”,

   “year”: “2004”,

   “genre”: “Romance”,

   “director”: “Nick Cassavetes”

},

   {

   “title”: “Footloose”,

   “year”: “1984”,

   “genre”: “Drama”,

   “director”: “Herbert Ross”

},

   {

   “title”: “The Green Mile”,

   “year”: “1999”,

   “genre”: “Drama”,

   “director”: “Steven King”

},

   {

   “title”: “Friday The 13th”,

   “year”: “1980”,

   “genre”: “Horror”,

   “director”: “Sean Cunningham”

}

] } . . .

"Order a similar paper and get 15% discount on your first order with us
Use the following coupon
"GET15"

Order Now