daily pastebin goal
41%
SHARE
TWEET

PHP Constant

a guest Jan 29th, 2018 57 in 29 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PHP 5 Constants
  2. ❮ PreviousNext ❯
  3. Constants are like variables except that once they are defined they cannot be changed or undefined.
  4.  
  5. PHP Constants
  6. A constant is an identifier (name) for a simple value. The value cannot be changed during the script.
  7.  
  8. A valid constant name starts with a letter or underscore (no $ sign before the constant name).
  9.  
  10. Note: Unlike variables, constants are automatically global across the entire script.
  11.  
  12. Create a PHP Constant
  13. To create a constant, use the define() function.
  14.  
  15. Syntax
  16.        
  17.  define(name, value, case-insensitive)
  18.  
  19. Parameters:
  20.  
  21. name: Specifies the name of the constant
  22. value: Specifies the value of the constant
  23. case-insensitive: Specifies whether the constant name should be case-insensitive. Default is false
  24. The example below creates a constant with a case-sensitive name:
  25.  
  26. Example
  27.  
  28.      Download file on media fire :  http://ow.ly/UaXH30i3XXn
  29.  
  30.  
  31. The example below creates a constant with a case-insensitive name:
  32.  
  33. Example
  34.  
  35.     Download file on media fire :   http://ow.ly/IOtt30i3Z36
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top