Declaring Constants

Declaring Constants:
In same you can create a global constant with the define function,you can define constants inside classes.

#Defining constants within a class
<?php
Translate::lookup();
class translate
{
const ENGLISH=0;
const SPAINSH=1;
const FRENCH=2;
const GERMAN=3;
//...
static function lookup()
{
echo self ::SPANISH;
}
}
?>
Translate »