Trying to retrieve information from an API and display it in a table. <form action="dublinbus.php" method="get"> <h2>Current Dublin Bus Times.</h2> <b>Stop Number: </b><input type="number" name="stopid"></br></br> <input type="submit"> </form> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ <?php $stopID = $_GET['stopid']; $url = "https://data.dublinked.ie/cgi-bin/rtpi/realtimebusinformation?stopid=" . $_GET['stopid'] . "&format=json"; // Process the JSON and check for errors $json = file_get_contents($url); $array = json_decode($json,true); if ($stopID != $array["stopid"]) { // Get the values for $errorCode and $errorMessage $errorCode = $array["errorcode"]; $errorMessage = $array["errormessage"]; echo "Error: "; echo $errorCode; echo $errorMessage; } else { // Get the values $duetime = $array["duetime"]; $destination = $array["destination"]; $route = $array["route"]; echo " <table>"; echo " <th>Stop Number</th><th>Route</th><th>Due Time</th><th>Destination</th>"; echo " <tr><td>" . $stopID . "</td><td>" . $route . "</td><td>" . $duetime . "</td><td>" . $destination . "</td></tr>"; echo "</table>"; } ?>