Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php access const in class

<?php
class MyClass
{
    const CONSTANT = 'constant value';

    function showConstant() {
        echo  self::CONSTANT . "
";
    }
}

echo MyClass::CONSTANT . "
";
?>
Comment

PREVIOUS NEXT
Code Example
Php :: php check if input is a positive integer 
Php :: wordpress login programmatically 
Php :: pagination always show 5 pages 
Php :: Route pattern cannot reference variable name more than once. laravel 
Php :: php show hide td 
Php :: Sending HTML Code Through JSON 
Php :: Token capabilities in vault 
Php :: php using composer autoload 
Php :: where to add browscap php 
Php :: how to enable auto refresh on save laravel 
Php :: php get the two number of time second 
Php :: laravel collection shift 
Php :: php get time past midnight 
Php :: laravel filesystem 
Php :: create a button add in laravel 
Php :: while in php 
Php :: php enablem mod 
Php :: twig render to string 
Php :: php find all subclasses of class 
Php :: Print array to a file 
Php :: server.php not found 
Php :: how to create route in laravel 
Php :: laravel many to many relationship 
Php :: laravel link to css or image 
Php :: php variables examples 
Php :: laravel enable query log 
Php :: laravel send mail using outlook 
Php :: php is datetime 
Php :: wordpress basic auth 
Php :: merge pdf php fpdf 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =