Syntax: string substr(string $string int $start [,int $end]), this function also intercepts by bytes (not characters), pay attention when intercepting Chinese, and the starting position of intercepting must be at the end position The left side of , that is, always intercepted from left to right.
$str="Hello world!";
echo substr($str,3),"
";//The result is lo world!
echo substr($str,3,8),"
";//result lo wo
echo substr($str,-6),"
";//At this time, the second parameter is a negative number, which means intercepting from the sixth position from the bottom, and the result is world
echo substr($str,-6,-3),"
";//When the third parameter is a negative number, it represents the intercepted length, and the result is wor
http://www.bkjia.com/PHPjc/1070924.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1070924.htmlTechArticleString function substr() in php Syntax: string substr(string $string int $start [,int $end ]), this function also intercepts by bytes (not characters), please pay attention when intercepting Chinese,...