开发者

Remove beginning of PHP string until it's 13 characters?

开发者 https://www.devze.com 2023-04-12 03:44 出处:网络
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

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消