Challenge 2 — Solution Task: Write a function fetchJson($url) that uses cURL to GET a URL, checks the HTTP status code, and returns the decoded JSON as an associative array if the code is 200, or null otherwise. Call it with a placeholder URL and handle both possible outcomes. Output: (Depends entirely on whether the placeholder URL actually responds with a real 200 status and valid JSON - for a genuinely unreachable placeholder URL like the one above, the expected output is:) Failed to fetch data from the API. Notes: - The return type ?array (a nullable array) matches exactly what the function can actually return - either a real decoded array on success, or null on any non-200 status - making the function's own contract explicit and self-documenting. - Checking $httpCode === 200 specifically (rather than just checking whether curl_exec() returned something) is essential, since curl_exec() can return a normal-looking string body even for a 404 or 500 error page - the status code is the only reliable way to know if the request actually succeeded. - The calling code checks "$result !== null" rather than a plain truthy/falsy check, since an empty (but successfully fetched) associative array would otherwise be indistinguishable from a genuine failure if a loose truthiness check were used instead.