我需要将文本拆分为两个部分,该函数可以完成但它在一个单词中间切断,我需要它来计算单词给出的开始或结束或采取几个字符。在125个字符后将文本字段拆分为两部分
因为我需要的字符范围不超过130个字符,所以我无法将它基于字数。
$str = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum"
$first125 = substr($str, 0, 125);
$theRest = substr($str, 125);
感谢
完美,非常感谢! – ConquestXD