summaryrefslogtreecommitdiffhomepage
path: root/php.html.markdown
diff options
context:
space:
mode:
authorChenbo Li <lichenbo1949@gmail.com>2013-08-02 23:44:26 +0800
committerChenbo Li <lichenbo1949@gmail.com>2013-08-02 23:44:26 +0800
commit90fa867a66323c9936b9b6f833f1c6b9eb7a16ad (patch)
treed236da21d945b9d6f9370b2d770aad19d59280ca /php.html.markdown
parent1a52aefcba5c31bb05b58290380509d6da81045c (diff)
parent3baf491ea66ddc77fb949c7aa5e988c318e372c0 (diff)
Merge branch 'master' of https://github.com/adambard/learnxinyminutes-docs into master-cn
Diffstat (limited to 'php.html.markdown')
-rw-r--r--php.html.markdown17
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
*/