jeudi 9 février 2017

PHP define constant declaration

Vote count: 0

I do not understand how this code work. displaying code below , in this code i defined a constant and the value is 10 but it display the output "constant is not defined".

why?

define('HELLO', 10);        
if(defined(HELLO))        
{        
    echo "Constant is defined";        
}        
else        
{        
    echo "Constant is not defined";        
}        

?>

asked 51 secs ago

Let's block ads! (Why?)



PHP define constant declaration

Aucun commentaire:

Enregistrer un commentaire