/ Published in: PHP
Cut PHP strings at full word breaks.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* usage: $string = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.'; $length = 3; echo implode(' ',array_slice(explode(' ', $string),0,$length)); */