Remove beginning of PHP string until it's 13 characters?
I have a variable that needs it's value's shortened until they are 13 characters. It needs to chop off characters from the beginning of the string. Is thi开发者_运维问答s built into PHP?
The following should work for you:
$str = substr($str, -13);
The substr
function is what you're looking for,
$text = "abcdefghijklmnopqrstuvwxyz";
$text = substr($text, -13);
Use substr
:
$v = substr($v, -13);
精彩评论