check url php code example
Example 1: get full url php
$fullURL = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
Example 2: how to check if a url is up php
<?php
$url = 'http://google.com';
if(@file_get_contents($url)){
echo "Website is up";
} else {
echo "Website is down";
}
?>