PHP如何获得包含home和user的文件的完整路径


PHP How to get Full Path to the file included home and user

如何在PHP中获得文件的完整路径?

例如:

 /home/yob/public_html/demo/envato/cce/tug/cron/cron.php

我想要文件所在的文件夹:

 /home/yob/public_html/demo/envato/cce/tug/cron/

PHP <5.3

$fullpath = dirname(__FILE__);

$fullpath = __DIR__;
http://php.net/manual/en/language.constants.predefined.php