![]() |
Trimming Row output for display
Hi,
I've got a query and string to display some information and usernames. One problem I'm having is long usernames. I'd like to truncate usernames longer than 8 characters to 6 characters then add ... after it. I can't seem to get this working in my while loop. Any help would be appreciated. here's what I've got right now inside the while loop Code:
if (strlen($row2->strUsrid) > 8) |
why are you doing 8-2 and not just 6?
|
well 6 wasn't working.
|
is Usrid the variable you want to be trimming? It would seem intuitive to be trimming a variable called Username (or whatever you store it in).
Unless of course you have the username stored in that variable. |
Use this:
PHP Code:
|
Thanks Brad.loo. That worked perfectly with the substituted string I needed to trim.
(and yes it was strusrid it's a custom table not native to vb3.) |
All times are GMT. The time now is 09:08 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|