From a46ae22bf785bf74334a309c9b2f0a64f5a05659 Mon Sep 17 00:00:00 2001 From: paierlep Date: Wed, 3 Jul 2013 19:50:20 +0200 Subject: [PATCH] Update php.html.markdown a few sentences to constants --- php.html.markdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/php.html.markdown b/php.html.markdown index f0c5c918..c6811282 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -99,6 +99,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 */