I have some fields in a database that are extremely long. If I display these fields in the browser, I get scroll bars for days. What I would like to do, is just display the first 20 characters of the field, followed by some ......, Is this possible?
if (strlen($string) >= 2) { echo substr(trim($string), 0, 2) . '...'; }
just replace 2 with the number of characters you want to truncate after.
-- cheers.
gracias