Web dev

Simple URL checker

$url = "https://www.nicolapietroluongo.com";
$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);
curl_exec($handle);
$httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);

if($httpCode == 404) {echo "ERROR 404 found";}

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.