-3

我们有文本变量:

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

谢谢。

4

2 回答 2

2

substr

echo substr($text, 40);
于 2010-08-17T07:18:21.403 回答
-1

使用 PHP 的substr

$stripped = substr($text, 0, 40);
于 2010-08-17T07:17:41.550 回答