starwars.php

    $triviaArray = json_decode(file_get_contents("data/starwars.json"), true);
    
    var_dump($triviaArray);
    print_r($triviaArray);


    foreach($triviaArray as $pt => $qn) {
        echo "<h2>{$qn["question"]} ($pt pts)</h2>\n<p>{$qn["answer"]}</p>\n";
    }

starwars.json

{
    "100": {
        "question": "Who stars as Han Solo in the original Star Wars films?",
        "answer": "Harrison Ford"
    },
    "200": {
        "question": "Who kills Jabba the Hutt?",
        "answer": "Princess Leia"
    },
    "300": {
        "question": "How many engines does the X-Wing fighter have?",
        "answer": "Four"
    },
    "400": {
        "question": "What callsign did Luke Skywalker have as an X-Wing pilot?",
        "answer": "Red Five"
    },
    "500": {
        "question": "How much does the Chewbacca costume weigh?",
        "answer": "8 pounds"
    }
}