我在变量中有以下字符串。
Stack Overflow is as frictionless and painless to use as we could make it.
我想先28个字符从上面的行提取,因此通常如果我用substr然后它会给我Stack Overflow is as frictio这个输出,但我想输出:
Stack Overflow is as...
是否有任
$string = "This is my page content. This text will be paginated.";
$pageNo = "0";
$pieceLength = "12";
$preparedForPrint = substr($string,$pageNo,$pieceLength);
我想要做的是,如果12字符是一个字内(第12字符不是一个空格),我