PHP program to print the full path of the current program file

bookmark

<?php
//PHP program to print the full path
//of the current program file.

class Sample
{
    public function PrintProgramPath()
    {
        print (__FILE__ . "<br>");
    }
}

$S = new Sample();

$S->PrintProgramPath();
?>


Output
/var/www/prog.php