# How to read FULL url?

**URL:** <https://forum.kirupa.com/t/how-to-read-full-url/289340>\
**Category:** Uncategorized\
**Created:** [May 29, 2009, 4:38am UTC](https://forum.kirupa.com/t/how-to-read-full-url/289340 "2009-05-29T04:38:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bzouchir](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/bzouchir/32/2088_2.png) [@bzouchir](https://forum.kirupa.com/u/bzouchir)\
**Post date:** [May 29, 2009, 4:38am UTC](https://forum.kirupa.com/t/how-to-read-full-url/289340/1 "2009-05-29T04:38:57Z")

</div>

Hi guys,

consider this:  
[http://test.com/?var=foo#test](http://test.com/?var=foo#test)

How can i read the full url in PHP?  
Tons of scripts and examples but the closest they get is  
[http://test.com/?var=foo](http://test.com/?var=foo)

i need to read the entire thing including “#test”

in javascript this is done with:  
top.location.href

how is this done in PHP?

thx
