> I wish to split my databased string in half to be shown on 2 seperate
> columns, but also preserve whole words. Is there a function that does this
> already? Maybe a quick fix? Hopefully something that doesn't include html
> tags as part of the string to split. If it's not that specific then that's
> okay.

I suppose that this would work if it weren't for the HTML tags inside your
text:

$text = "Suppose this text was really long.";
$half_length = (int) strlen($text) / 2;
$split = wordwrap($text, $half_length, "</TD><TD>");
echo "<TABLE><TR><TD>$split</TD></TR></TABLE>";

Now, once you throw HTML tags into your string, you are in a much trickier
problem...  Don't really see *any* solution for that in a general sense,
since somebody could use a tag that spans the entire text, and then you
can't break it in half at all...

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to