...

View Full Version : wordwrap() help please



pankirk
06-27-2010, 01:13 AM
So I wrote this to make my strings "format" themselves:


$text = "This is a test string that's being formatted!";
$newtext = wordwrap($text, 20, "<br />");
echo $newtext;

The problem I'm facing is that it correctly formats strings like this:


This is a test string that's being formatted!

But it completely ignores strings like this:

ASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDFASDF ASDFASDFASDFASDFASDFASDFASDF

What can be done about this? Thanks
-P

Fou-Lu
06-27-2010, 02:56 AM
Set wordwrap's fourth argument to true, this will force a cut in the middle of a string.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum