From a46ae22bf785bf74334a309c9b2f0a64f5a05659 Mon Sep 17 00:00:00 2001 From: paierlep Date: Wed, 3 Jul 2013 19:50:20 +0200 Subject: Update php.html.markdown a few sentences to constants --- php.html.markdown | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'php.html.markdown') 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 */ -- cgit v1.2.3 From 040896b050e92a44c7c58be51ff4c9b8b7bb523d Mon Sep 17 00:00:00 2001 From: paierlep Date: Wed, 3 Jul 2013 19:55:03 +0200 Subject: Update php.html.markdown ?> instead of ? > --- php.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'php.html.markdown') diff --git a/php.html.markdown b/php.html.markdown index c6811282..73445839 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -8,7 +8,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. -- cgit v1.2.3