php - How can we split a sentence -


i have written php code getting part of given dynamic sentence, e.g. "this test sentence":

substr($sentence,0,12); 

i output:

this te 

but need stop full word instead of splitting word:

this 

how can that, remembering $sentence isn't fixed string (it anything)?

use wordwrap


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -