- BASICS
- Quotes
- Constants
- Control Structures
- Reference
- Number Systems
- VARIABLES
- Definition
- Variable Variable
- Exists
- Type Casting
- OPERATORS
- Aritmetic
- Bitwise
- String
- Comparison
- Logical
- FUNCTION
- Definition
- Anonymous
- Reference
- Variable Arguments
- ARRAY
- Basics
- Operations
- Create
- Search
- Modify
- Sort
- Storage
- STRING
- String Basics
- String Compare
- String Search
- String Replace
- String Format
- String Regexp
- String Parse
- Formating
- Json
- STREAMS
- File Open
- Read File
- Read Csv
- File Contents
- Context
- Ob_start
- OOP
- Object Instantiation
- Class Constructor
- Interfaces, Abstract
- Resource Visibility
-
Class Constants
- Namespaces
- HTTP
- Headers
- File Uploads
- Cookies
- Sessions
Class constants
Class constants are public, and accessible from all scopes.
class A
{
const BAR = "Hello World";
}
echo A::BAR; // Hello World
Class constants can be define as array.
class A
{
const BAR = array(1, 2, 3);
}
print_r(A::BAR); // [1, 2, 3]
Last update: 531 days ago