Hi,
I have problem when to get url value like this :
"http://localhost/link.php?pos=16#id31"
I want to get "31" value?
Could anyone help me?
Thanks b4,
$a = parse_url(); echo $a['fragment'];
Thanks for your reply but it not run? I have found error like this :
Warning: parse_url() expects exactly 1 parameter, 0 given in C:\Program Files\xampp\htdocs\Belajar\Test1\link2.php on line 16
<? $a = parse_url(); print_r($a['fragment']); ?>
Well, then pass the URL in question as the argument to parse_url.
The URL fragment is never sent to the server, therefore it cannot fetch it.
Consider using Javascript instead.
Mark
We dont know exactly how the OP is getting the URL(s).
This code works.