Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

    Step: 1

    blur-text-image

    Get Instant Access to Expert-Tailored Solutions

    See step-by-step solutions with expert insights and AI powered tools for academic success

    Step: 2

    blur-text-image

    Step: 3

    blur-text-image

    Ace Your Homework with AI

    Get the answers you need in no time with our AI-driven, step-by-step assistance

    Get Started

    Recommended Textbook for

    How Do I Use A Database Research Tools You Can Use

    Authors: Laura La Bella

    1st Edition

    1622753763, 978-1622753765

    More Books

    Students also viewed these Databases questions

    Question

    13. You always should try to make a good first impression.

    Answered: 1 week ago