ho con successo prelevo siti web conCome evitare l'errore file_get_contents: "Impossibile risolvere il nome host"
file_get_contents("http://www.site.com");
Tuttavia, se l'URL non esiste, o non raggiungibile, io sono sempre
Warning: file_get_contents(http://www.site.com) [function.file-get-contents]:
failed to open stream: operation failed in /home/track/public_html/site.php
on line 773
È possibile echo "Site not reachable";
invece dell'errore?
provare '@file_get_contents (...) ':) – migg
Grazie. Tuttavia, ho letto da qualche parte che non dovrei usare quello @ perché non è un buon modo. – user198989
Domanda duplicata: http://stackoverflow.com/questions/272361/how-can-i-handle-the-warning-of-file-get-contents-function-in-php. –