Friday 15 April 2016

PHP Predefined Constants

PHP Predefined Constants

Php in default has some predefined constants. This post explains about some major PHP magic constants.

  • __DIR__ – The directory of the file.
  • __FILE__ – The full path and filename of the file.
  • __CLASS__ – The class name.
  • __FUNCTION__ – The function name.
  • __METHOD__ – The class method name.
  • __LINE__ – The current line number of the file.
  • __NAMESPACE__ – The name of the current namespace

No comments:

Post a Comment