lundi 27 août 2018

Manupulate Error file_get_contents

I have a script

$data = file_get_contents('http://my_example_link/data.xml');

and if http://my_example_link/data.xml is showing error

Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

I would like to create condition if the link is showing error above I will showing alert notification using bootstrap panel.

can I doing like that ?

Aucun commentaire:

Enregistrer un commentaire