faqts : Computers : Programming : Languages : PHP : Common Problems : Files

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

79 of 107 people (74%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

Does PHP have an equivalent to ASP's Server.MapPath() function, which retrieves absolute file paths?

Nov 12th, 2002 20:38
Juan Carlos Gonzalez, grandmaster plarmz,


If you have for example a file in ../files/bar.txt and the real path 
is d:/cvs/temp/files/bar.txt you can get this information using:

$real_path = realpath("../files/bar.txt"); // this will return 
d:/cvs/temp/files/bar.txt