Quick Search:
 
 PHP Code: Split URL into parts ver A Jump to:  
Category: >> PHP Code >> Split URL into parts ver A  

<< lastnext >>

Snippet Name: Split URL into parts ver A

Description: Decomposes a URL completely.

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: February 28th, 2009

<?PHP
 
$fullurl = "http://www.domain.com/cgi-bin/printurl.cgi?url=http://test.com&[email protected]";
 
ECHO "The full URL: " . $fullurl . "<br><br>\n";
 
$fullurl = EREGI_REPLACE("http://", "", $fullurl);
ECHO "The full URL without http: " . $fullurl . "<br><br>\n";
 
$request_part =  STRISTR($fullurl, "/");
ECHO "The request part: " . $request_part . "<br><br>\n";
 
$main_url = SUBSTR($fullurl, 0, STRPOS($fullurl, "/"));
ECHO "The domain only: $main_url";
 
?>


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org