- 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
Concatenation
Concatenation operator concatenate right and left arguments.
$a = "a";
$b = "b";
echo $a . $b; // ab
Special
PHP has a special operator that can be used to concatenate two strings.
$a = "a";
$b = "b";
echo $a .= $b; // ab
# Using the + operator, like in Java ...
# will result in TypeError (PHP 8+)
echo $a += $b; // Unsupported operant types
Last update: 531 days ago