Challenge 1 — Solution Task: Create an associative array representing a book with keys "title", "author", and "year". Echo a formatted sentence using all three values, then add a new key "genre" and echo the whole array with print_r. "The Pragmatic Programmer", "author" => "David Thomas", "year" => 1999 ]; echo $book["title"] . " by " . $book["author"] . " (" . $book["year"] . ")
"; $book["genre"] = "Software Engineering"; print_r($book); ?> Output: The Pragmatic Programmer by David Thomas (1999) Array ( [title] => The Pragmatic Programmer [author] => David Thomas [year] => 1999 [genre] => Software Engineering ) Notes: - Each value is accessed with its own named key rather than a numeric position, e.g. $book["title"] rather than $book[0]. - Assigning to a key that doesn't exist yet ($book["genre"] = ...) simply adds it to the array - no special "add a new key" syntax is needed beyond a normal assignment. - print_r() shows every key-value pair in the array in a readable format, confirming the new "genre" key was added successfully alongside the original three.