Fri, 17 May 2024


How to use the parse_url function to parse an URL?

By: Nathalie, NetArt Media
Sun, 25 October 2020

<?php

$myDomain = parse_url("http://www.netartmedia.net/php.html#examples");

echo "Domain: " . $myDomain["host"] . "<br>";
echo "Query String: " . $myDomain["query"] . "<br>";
echo "Anchor: " . $myDomain["fragment"] . "<br>";

?>


Category: PHP Examples
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox