The substr () function returns part of the string.
Grammar
SUBSTR (String,start,length)
The arg2 of the method and the arg2 of the other two methods simply represent different meanings, so they are singled out.
When arg1<0, the results of different browsers are different. IE directly change the arg1 to 0, and the Chrome subscript reads from left to right to read from right to left
<?php Tutorial
echo substr ("Hello world!", 6);
?> output:
world! Example 2
<?php
echo substr ("Hello world!", 6,5);
?> output:
World
Parameters
String
String type.
Start
A positive integer that specifies the start position in string. The position of the first character in the string is 1.
Length
A positive integer that specifies the length of the character to search for in string. If length is not specified, the substring continues to the end of the string.
Note the ordinal number of the first character in string is 1, unlike other functions that handle table elements, such as Nth and ssname: They treat the ordinal number of the first element as 0.
return value