How to get current directory, filename and code line number in PHP
Clarity TLDR: Use __DIR__ for the current script’s directory, basename(__FILE__) for the current filename, and __LINE__ for the current line number. The older dirname(__FILE__) form still works, but __DIR__ is the modern equivalent. Examples of each below. In PHP, there are several built-in functions that can be used to obtain information about the current script’s
How to get current directory, filename and code line number in PHP Read More »




