Character display
Moderator: General Moderators
-
thoughtriot
- Forum Commoner
- Posts: 26
- Joined: Thu Nov 07, 2002 9:32 pm
Character display
I have a test field called Entry for a news table, and I was wondering how I could put a little "preview" of the latest entry on a page where only x amount of letters/characters are displayed, then I'll just put a "Read more >" link or something. But how would I only display 50 or so characters, please?
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You'd want to either limit how much of the string you either selected or output. Take a look at:
LEFT(): http://www.mysql.com/doc/en/String_func ... ml#IDX1175
or for a PHP version:
substr(): http://www.php.net/substr
Mac
LEFT(): http://www.mysql.com/doc/en/String_func ... ml#IDX1175
or for a PHP version:
substr(): http://www.php.net/substr
Mac