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
8T8
Forum Newbie
Posts: 2 Joined: Fri Mar 23, 2007 2:07 pm
Post
by 8T8 » Fri Mar 23, 2007 2:08 pm
Hi, I'm failry new to PHP. What is the best way to obtain the first letter in a string?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Mar 23, 2007 2:11 pm
impulse()
Forum Regular
Posts: 748 Joined: Wed Aug 09, 2006 8:36 am
Location: Staffordshire, UK
Contact:
Post
by impulse() » Fri Mar 23, 2007 2:17 pm
I've always tended to use $string[x]. x being the position in the string.
8T8
Forum Newbie
Posts: 2 Joined: Fri Mar 23, 2007 2:07 pm
Post
by 8T8 » Fri Mar 23, 2007 2:19 pm
Brilliant, Thanks! Its easy when you know how
Ambush Commander
DevNet Master
Posts: 3698 Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US
Post
by Ambush Commander » Fri Mar 23, 2007 3:44 pm
Be sure to test that the string is not empty, though.