substr
Arguments
The function accepts three arguments. The first two arguments are required, the third argument is optional:
-
string is a string the substring will be extracted from;
-
start is the start position of the substring in characters. The first character has a position of 1. If position is 0, it is treated as 1. If start position is negative, it is counted from the end of the string;
-
length is the length of the substring in characters. If omitted, the whole string will be returned from the start position.