Jan 27, 2009 #1 Brianfree Programmer Feb 6, 2008 220 GB Hi i have some text from a database like... 1234567890 1234567890abcdefgh how can i trim text over 15chs so it looks like.. 1234567890abcde... Many thanks, Brian
Hi i have some text from a database like... 1234567890 1234567890abcdefgh how can i trim text over 15chs so it looks like.. 1234567890abcde... Many thanks, Brian
Jan 27, 2009 #2 feherke Programmer Aug 5, 2002 9,541 RO Hi Supposing your text is in variable $str, I would do this : Code: if (strlen($str)>15) $str=substr($str,0,15)."..."; Feherke. http://rootshell.be/~feherke/ Upvote 0 Downvote
Hi Supposing your text is in variable $str, I would do this : Code: if (strlen($str)>15) $str=substr($str,0,15)."..."; Feherke. http://rootshell.be/~feherke/