我想将字符串分解为max 35 character
,但是智能中断。假设我有以下字符串:PHP字符串中的智能字符串中断
street name, sector name, city, state, pincode
或
ABC Heights, Golf Road, City Test, City Sector
现在,我想这些字符串无论如何都要打破,但须智能没有打破任何错行。
例如,休息可以
ABC Heights, Golf Road,<br/>
City Test, City Sector
这里
,但没有运气不
ABC Heights, Golf Road,City Te<br/>
st, City Sector
我已经试过的答案。
[wordwrap](http://php.net/manual/en/function.wordwrap.php)+ [nl2br](http://php.net/nl2br) –