PHP

How to print the full path of the current program file in PHP | PHP programs

How to print the full path of the current program file in PHP | PHP programs

How to print the full path of the current program file in PHP | PHP programs

We will print the full path of the current program file using magic constant __FILE__.

<?php


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

$S = new Sample();

$S->PrintProgramPath();
?>
TutorialsLink Curator

This is an official account managed by the team TutorialsLink Community