diff --git a/php.html.markdown b/php.html.markdown index e81b88fd..5f5a4b54 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -9,7 +9,7 @@ filename: learnphp.php This document describes PHP 5+. ```php - tags + tags // If your php file only contains PHP code, it is best practise // to omit the php closing tag. @@ -100,6 +100,21 @@ END; echo 'This string ' . 'is concatenated'; +/******************************** + * Constants + */ + +// A constant is defined by using define() +// and can never be changed during runtime! + +// a valid constant name starts with a letter or underscore, +// followed by any number of letters, numbers, or underscores. +define("FOO", "something"); + +// access to a constant is possible by direct using the choosen name +echo 'This outputs '.FOO; + + /******************************** * Arrays */