Hello, I am trying to display information from the database, if i get long sentence without break or space it does not fit to my table and breaks my design. My code is <table width="720" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="left">'.$row['description'].'</td> </tr> </table> PHP: When i get something like this sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss from database it messes with my design. What can i do? Thanks
maybe this will give you some idea.. **LEFT(str,len) Returns the leftmost len characters from the string str, or NULL if any argument is NULL. mysql> SELECT LEFT('foobarbar', 5); -> 'fooba' ***LENGTH(str) Returns the length of the string str, measured in bytes. A multi-byte character counts as multiple bytes. This means that for a string containing five two-byte characters, LENGTH() returns 10, whereas CHAR_LENGTH() returns 5. mysql> SELECT LENGTH('text'); -> 4 hope this help
ok. i sorted. $text=$row['description']; $newtext = wordwrap($text, 100, "\n", true); echo "$newtext\n"; PHP: