注:如果 start 参数是负数且 length 小于或即是 start,则 length 为 0。
substr(string,start,length)
string 必需。规定要返回个中一部分的字符串。

start 必需。规定在字符串的何处开始。
正数 - 在字符串的指定位置开始
负数 - 在从字符串结尾的指定位置开始
0 - 在字符串中的第一个字符处开始
length 可选。规定要返回的字符串长度。默认是直到字符串的结尾。
正数 - 从 start 参数所在的位置返回
负数 - 从字符串末端返回
返回值: 返回字符串的提取部分,如果失落败则返回 FALSE,或者返回一个空字符串。
<?phpecho substr("this is tom",10)."<br>";echo substr("this is tom",1)."<br>";echo substr("this is tom",3)."<br>";echo substr("this is tom",7)."<br>"; echo substr("this is tom",-1)."<br>";echo substr("this is tom",-10)."<br>";echo substr("this is tom",-8)."<br>";echo substr("this is tom",-4)."<br>";?>