Page 1 of 1

showing a limited number of characters in a string.

Posted: Thu Apr 27, 2006 1:08 pm
by mattyboi
I have a field in a database that allows a lot of characters. I would only like to show the first 20 characters or so when I display it on the webpage.

Any ideas?

Posted: Thu Apr 27, 2006 1:18 pm
by timvw
Probably your dbms has builtint functions for strings... Usually it's called SUBSTRING or SUBSTR... And php has one too (as a last resort).