Display set number of characters

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Display set number of characters

Post by GeXus »

Does any know how I would display x number of characters? Say for example a description, I want to only display 100 characters max then have like "... more" type of deal..

Thanks!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

strlen() to see if it's over the "limit", substr() to snip the string.
Post Reply