Limit length of a word/string (FIXED)
Posted: Thu Jan 21, 2010 4:59 pm
Hey Guru's,
I have a small problem, if a user submits data which is 1 word but 600 charcters long it will run off my template and make the page width really wrong when that word is output. I would like to limit the size of words so they do not run outside my page. I have done some googleing and came across php's wordwrap so I tried to implement it.
Have I done it wrong? Is there a better way? Just a little help please 
I have a small problem, if a user submits data which is 1 word but 600 charcters long it will run off my template and make the page width really wrong when that word is output. I would like to limit the size of words so they do not run outside my page. I have done some googleing and came across php's wordwrap so I tried to implement it.
Code: Select all
$theproof = nl2br($row['proof']);
echo wordwrap($theproof, 20, "<br />\n");