Created
February 9, 2016 06:32
-
-
Save yokesharun/af58ca9feab2fe947559 to your computer and use it in GitHub Desktop.
PHP Get path | domain | Queries of the particular url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = '//www.example.com/path?googleguy=googley'; | |
// Prior to 5.4.7 this would show the path as "//www.example.com/path" | |
var_dump(parse_url($url)); | |
//output will be like | |
// array(3) { | |
// ["host"]=> | |
// string(15) "www.example.com" | |
// ["path"]=> | |
// string(5) "/path" | |
// ["query"]=> | |
// string(17) "googleguy=googley" | |
// } | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment