I show a name on a page from a DB with this $user[txtMSName]
The problem is some names are so long they mess up my layout how can I limit it to20 characters then inserts a <BR> tag?
limit text length displayed?
Moderator: General Moderators
-
jasondavis
- Forum Commoner
- Posts: 60
- Joined: Sat Feb 04, 2006 5:35 pm
-
jasondavis
- Forum Commoner
- Posts: 60
- Joined: Sat Feb 04, 2006 5:35 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
$username substr($user['txtMSName'],0,4);- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
I think wordwrap() is your friend here