Jump to content

server.mappath alike command?


sorex

Recommended Posts

Hello,Is there a way to retrieve the relative path to a given file or url in PHP?in ASP I can use server.mappath("/text/text.txt") which would give me c:\inetput\wwwroot\text\text.txt as result.Can't seem to find something simular for PHP tho ???(unless it's realpath which doesn't seemt to work under XP?)

Link to comment
Share on other sites

realpath() seems to be equivalent to ASP's Server.MapPath. On my Win2k box I have successfully used realpath() to give me the full path for a file outside of the document_root. This will be very useful in conjunction with is_dir and/or is_file, which require a full path.
What does it do under XP?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...