FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » use of substring in php
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
use of substring in php [message #174592] Mon, 20 June 2011 21:19 Go to previous message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma:
Member
Hi All,

I want to cut down the name of the user to 10 characters so it will
fit to the picture of the user.
At this moment I use $firstnameCut = substr($firstname, 0, 10);
However sometimes the name is like:

Johannes Paul.
with my code it will show: Johannes P

How can I change this so if the second or third name doesn't fit
within the 10 characters
it will not be shown at all?

Regards
Marco
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Compiling PHP error
Next Topic: free computer ebooks updated daily
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 12:43:06 GMT 2024

Total time taken to generate the page: 0.03191 seconds