Skip to content

Commit

Permalink
Merge pull request adambard#96 from paierlep/master
Browse files Browse the repository at this point in the history
added a few sentences about constants
  • Loading branch information
adambard committed Aug 2, 2013
2 parents 4ecd73f + 040896b commit 3baf491
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion php.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
*/
Expand Down

0 comments on commit 3baf491

Please sign in to comment.