please show me how to use php to detect file path without document name

i dont want the decument or file name to be shown, just the full url without the current file name only the url in the address bar

can i do that with PHP?