What is the command for this in PHP

Hi!.

I want to get my current virtual directory structure using PHP.
What is the command for this?

For example - my current local address,

[B][noparse]http://localhost/myfiles/folder1/abc.php[/noparse][/B]

I want to get [B][noparse]http://localhost/myfiles/folder1/[/noparse][/B] from it.
Please tell me any way…

<?php
$url = ‘http://localhost/myfiles/folder1/abc.php’;
echo dirname($url);
?>