Connor Simpson
Connor Simpson

Reputation: 487

Web path instead of actual path

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).

Upvotes: 0

Views: 80

Answers (2)

Sam
Sam

Reputation: 2970

Maybe you want the request uri?

echo $_SERVER['REQUEST_URI'];

If not, you must do your custom function/url

Upvotes: 1

deceze
deceze

Reputation: 522626

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.

Upvotes: 1

Related Questions