Parse_url function

Parse_url function

parse_url function parse a URL and return its components. This function returns an associative array with the following components which is listed below.

Scheme, host , port , user , pass , path , query after the question mark ? , fragment after the hash #.

Example :<?php

<?php$input = “http://localhost/first/index.php?param=54#id=2″;

$output=parse_url($input);

print_r($output);

// will give all the URL details as follows

Array ( [scheme] => http [host] => localhost [path] => /first/index.php [query] => param=54 [fragment] => id=2 )

?>

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.