April 2026
Intermediate
1009 pages
34h 15m
English
One function for cutting out parts of a string is substr(). It finds its actual home in this section. There are also some other auxiliary functions, such as to remove spaces.
substr(string, start position, length) has three parameters:
string specifies the string that is to be cut.
start position determines where the cutoff begins.
length specifies how many characters are truncated. This parameter is optional. If it is omitted, substr() returns all characters from the start position to the end of the string.
What characterizes substr() is its relatively high flexibility. Take a look at a few examples. The starting point is the following string:
$a = "PHP CMS SHOP";
If you only specify a (positive) ...
Read now
Unlock full access