Jan 27, 2009 #1 Brianfree Programmer Joined Feb 6, 2008 Messages 220 Location 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 Joined Aug 5, 2002 Messages 9,541 Location 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/