I have PHP code where it is set API URL and API key. An example:
<?php
$apiKey = 'XXX';
$url = "https://api.openweathermap.org/data/3.0/onecall?lat=$lat&lon=$lon&units=metric&appid=$apiKey";
$response = file_get_contents($url);
$data = json_decode($response, true);
echo "
echo "
";
?>
If there is empty value for an API key or data feed not working, I should prevent seeing echo content. Is there possibility to block further visibility?