- 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
Quotes
Variables are interpreted and replaced, but only with double quotes.
$a = 4;
echo '$a'; // $a
echo "$a"; // 4
Herodoc
Herodoc format is used for formating on multiple lines.
/**
* Herodoc strings
*
* It is used for formating on multiple lines.
* You can use quotes without escaping.
*
* The closing identifier must contain no characters, except a semicolon (;)
* The first character after the closing identifier must be a newline.
*/
$who = "John";
$output = <<<TEST
She said "This is $who's test"
on multiple rows
TEST;
echo nl2br($output);
/*
She said "This is John's test"
on multiple rows
*/