Class Constants

PHP 5 allows class specific constants, which works just like regular constants, but are limited to the scope of the given class.

<?php
class foo {
    const file_name = __FILE__;
}

echo foo::file_name; // will print current file name
?>

Loading ...

Related Results :

  1. Class Constants
Note :
  • Related Posts are generally User Blog posts.
  • or Other tutorials from other networks of w3clan.com.
  • Any registered user can create related posts based on search term tags.

About the Author