Page 1 of 1

Split long text string in half without breaking a word

Posted: Sun Sep 28, 2003 8:53 pm
by ramius
Does anyone know how to split a long text string from say a forums program by a fraction i.e. half third etc. without breaking a word in half?

Posted: Sun Sep 28, 2003 10:03 pm
by JAM
I can only think of [url=http://se.php.net/manual/en/function.wordwrap.php]wordwrap() but that is with simply using an existing function.

You can surely build something fun using str_pos() or similiar also.

You dont mention any reason for it, so it's hard to put it in perspective usage.