Question: I'm trying to run a code using php and json but I am getting a warning of an invalid argument. Please help movies.php movies.json {

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

movies.php

"; 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" } ]

    }

    Step by Step Solution

    There are 3 Steps involved in it

    1 Expert Approved Answer
    Step: 1 Unlock blur-text-image
    Question Has Been Solved by an Expert!

    Get step-by-step solutions from verified subject matter experts

    Step: 2 Unlock
    Step: 3 Unlock

    Students Have Also Explored These Related Databases Questions!