开发者

Strip letters in php

开发者 https://www.devze.com 2023-01-11 17:18 出处:网络
We have variable with text: $text = \'I use something similar to pull the most recent pos开发者_如何转开发t from my blog and display a snapshot of it on my home page.\';

We have variable with text:

$text = 'I use something similar to pull the most recent pos开发者_如何转开发t from my blog and display a snapshot of it on my home page.';

How to strip first 40 symbols of this text? (including spaces).

Should work like this:

echo strip_text($text, 40);

Thanks.


With substr:

echo substr($text, 40);


Use PHP's substr:

$stripped = substr($text, 0, 40);
0

精彩评论

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