Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们有文本变量:
$text = 'I use something similar to pull the most recent post from my blog and display a snapshot of it on my home page.';
如何去除此文本的前 40 个符号?(包括空格)。
应该像这样工作:
echo strip_text($text, 40);
谢谢。
与substr:
substr
echo substr($text, 40);
使用 PHP 的substr:
$stripped = substr($text, 0, 40);