$_SERVER['DOCUMENT_ROOT']
Say you want to check if a file exists, you could do this:
file_exists($_SERVER['DOCUMENT_ROOT']."/yourfolder/yourfile.extension")
Putting this in an IF statement will see if the file exists. If it does, file_exists will return true, else it will return false.
No comments:
Post a Comment