PHP - Concatenate Strings
Posté 2024-05-17 07:30:24
0
9KB
String Concatenation
To concatenate, or combine, two strings you can use the .
operator:
The result of the example above is HelloWorld
, without a space between the two words.
You can add a space character like this:
An easier and better way is by using the power of double quotes.
By surrounding the two variables in double quotes with a white space between them, the white space will also be present in the result:
Complete PHP String Reference
For a complete reference of all string functions, go to our complete PHP String Reference.
Rechercher
Catégories
- Art
- Causes
- Crafts
- Dance
- Drinks
- Film
- Fitness
- Food
- Jeux
- Gardening
- Health
- Domicile
- Literature
- Music
- Networking
- Autre
- Party
- Religion
- Shopping
- Sports
- Theater
- Wellness
Lire la suite
PHP Global Variables - Superglobals
Superglobals were introduced in PHP 4.1.0, and are built-in variables that are always available...
PHP Sorting Arrays
The elements in an array can be sorted in alphabetical or numerical order, descending or...
PHP Variables Scope
PHP Variables Scope
In PHP, variables can be declared anywhere in the script.
The scope of a...
PHP Nested if Statement
Nested If
You can have if statements inside if statements, this is...
PHP Update Array Items
Update Array Item
To update an existing array item, you can refer to the index number for...