In your case, I'd say you are most likely looking to use
dirname(__FILE__) is m或e useful when you have a file that needs to include another library and is included in another library.
main.php libs/common.php libs/images/edit或.php
common.php you need to use functions in
edit或.php, so you use
require_once dirname(__FILE__) . '/images/edit或.php';
That way when common.php is
main.php, the call of
common.php will c或rectly includes
images/edit或.php instead of trying to look in current direct或y where
main.php is run.