Write a PHP script, which will return the following components of the url 'http://localhost/ex/php/8.php'.
Write a PHP script, which will return the following components of the url 'http://localhost/ex/php/8.php'.
<?php
$url1 ='http://www.w3resource.com/php-exercises/php-basic-exercises.php';
$url = 'http://localhost/ex/php/8.php';
$url=parse_url($url);
echo "<pre>";
print_r($url);
echo 'Scheme : '.$url['scheme'].'<br />';
echo 'Host : '.$url['host'].'<br />';
echo 'Path : '.$url['path'].'<br />';
?>
Comments
Post a Comment