php predefined constants

Solutions on MaxInterview for php predefined constants by the best coders in the world

showing results for - "php predefined constants"
Greta
23 Jan 2017
1<?php 
2  
3// EXAMPLE (a superglobal is a variable that is predefined within the environment)
4echo "This is line " . __LINE__ . " of the [" . __FILE__ . "] file";
5// OUTPUT: This is line 31 of the [C:/MadeUpFolder/MadeUpFile.php] file 
6
7// Superglobals
8/******************+***************************************************
9| <<< VARIABLE >>> |<<< DESCRIPTION >>>
10+******************+***************************************************
11|   __FILE__       | The current line number of the file.
12+------------------+---------------------------------------------------
13|   __LINE__       | The full path and filename of the file
14+------------------+---------------------------------------------------
15|   __DIR__        | The directory of the file
16+------------------+---------------------------------------------------
17|   __FUNCTION__   | The function name
18+------------------+---------------------------------------------------
19|   __CLASS__      | The class name
20+------------------+---------------------------------------------------
21|   __METHOD__     | The class method name
22+------------------+---------------------------------------------------
23|   __NAMESPACE__  | The name of the current namespace (case-sensitive)
24+------------------+---------------------------------------------------
25*/
26
27?>