Web路径而不是实际路径

I'm looking for a solution where you can change the output of:

echo dirname(__FILE__); # Output: C:\inetpub\wwwroot\hot

To and output of a web path (example/example.html).

You need to make your own links. There are an infinite number of possible URLs that may lead to a particular file on the hard disk. Mapping a local path to a URL is not automagically possible.

Maybe you want the request uri?

echo $_SERVER['REQUEST_URI'];

If not, you must do your custom function/url