我在變量中有以下字符串。
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字符不是一個空格),我