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

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

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