Get just 2 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
gotornot
Forum Commoner
Posts: 54
Joined: Fri Jul 31, 2009 2:30 am

Get just 2 characters

Post by gotornot »

Hi
What code would i use to take the first 2 letters of a post code so for example
CM11 2AY
I want the CM bit what command would strip the first 2 characters out?

Thanks
gotornot
Forum Commoner
Posts: 54
Joined: Fri Jul 31, 2009 2:30 am

Re: Get just 2 characters

Post by gotornot »

thanks very much people i worked it out in the end but really good thanks.
Whatis the best command for srtipping out the numbers if any are included?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Get just 2 characters

Post by califdon »

These are things you can easily learn about from the PHP manual or references like this:
http://www.w3schools.com/php/php_ref_string.asp
Post Reply