diff options
author | Adam Bard <github@adambard.com> | 2013-08-01 23:52:25 -0700 |
---|---|---|
committer | Adam Bard <github@adambard.com> | 2013-08-01 23:52:25 -0700 |
commit | 3baf491ea66ddc77fb949c7aa5e988c318e372c0 (patch) | |
tree | 0b2466a580b5dd2bcd6d12e1165ef33d0eb610f5 /php.html.markdown | |
parent | 4ecd73fc9cd766557e10fc2fa0c3351c373ff1a0 (diff) | |
parent | 040896b050e92a44c7c58be51ff4c9b8b7bb523d (diff) |
Merge pull request #96 from paierlep/master
added a few sentences about constants
Diffstat (limited to 'php.html.markdown')
-rw-r--r-- | php.html.markdown | 17 |
1 files changed, 16 insertions, 1 deletions
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 -<?php // PHP code must be enclosed with <?php ? > tags +<?php // PHP code must be enclosed with <?php ?> tags // If your php file only contains PHP code, it is best practise // to omit the php closing tag. @@ -101,6 +101,21 @@ 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 */ |