Get the current PHP script absolute path method

一、dirname(__FILE__)

For example: where is the path a.php /var/www/web/a.php

dirname (__ FILE__) is returned / var / www / web /

二, __ DIR__

A.php value obtained is used __DIR__ / var / www / web /

Guess you like

Origin www.cnblogs.com/phperlinxinlan/p/11164964.html