You can use the functionparse_url to get the local part of the url.
Converting this to a file path requires you to know where the document root is located on the web server. If this is the same server as the one the page is running on, you can usually get this from $_SERVER['DOCUMENT_ROOT'].
, URL- (, mod_rewrite, mod_alias, URI, MVC- ..). , , , http://example.com/blog/2012/01/01/, /home/user// script/recall.psgi /home/user/recall/root/blog/day.tt, DocumentRoot /home/user/remember/htdocs/)