i want to get the string after # tag in url with php. but there is no function to find it. so i get it by the javascript on the same page and call that variable into php by
<script>
var query = location.href.split('#');
var a = String(query[1]);
</script>
<?php
$variable = "<script>document.write(a)</script>";
print_r (explode("%",$variable));
?>
but this code print the string as it is and it doesn't split by %.
gives the result like
Array ( [0] => z%a )
for this link http://immersed.in/CodeIgniter/#z%a
please help what to do