RE: [PHP] Zip to postcode[Scanned]

2003-04-02 Thread Ford, Mike [LSS]
> -Original Message- > From: Michael Egan [mailto:[EMAIL PROTECTED] > Sent: 02 April 2003 13:05 > > There are some ready made scripts for dealing with UK post > codes on the relevant page on the PHP site: > > http://www.php.net/manual/en/function.ereg.php And not one of them is 100% cor

Re: [PHP] Zip to postcode

2003-04-02 Thread William Bailey
Hi Andy, The following function seems to work for me: function split_postcode ($postcode) { if(eregi('(^[A-Z]{1,2})([0-9|A-Z]{1,2}).*([0-9][A-Z]{2}$)', str_replace(' ', '', $postcode), $parts)){ $outcode=strtoupper(sprintf('%s%s%s', $parts[1], @str_repeat(' ', 4-strlen($part

re: [PHP] Zip to postcode

2003-04-02 Thread Peter Hicks
Don't forget some London postcodes are Q1Q QQQ! Peter. On Wed, 2 Apr 2003, skate wrote: > sorry, don't have anything to add for code, but just a note to remember that UK post > codes can also be in the form... > > QQ11 1QQ > Q1 1QQ > Q11 1QQ > QQ1 1QQ > > so it's a real pain to write an expr

re: [PHP] Zip to postcode

2003-04-02 Thread skate
sorry, don't have anything to add for code, but just a note to remember that UK post codes can also be in the form... QQ11 1QQ Q1 1QQ Q11 1QQ QQ1 1QQ so it's a real pain to write an expression for this... -skate- Can someone please tell me how i change the following code: if (!ereg("^[0-9]{

RE: [PHP] Zip to postcode[Scanned]

2003-04-02 Thread Michael Egan
Andy, There are some ready made scripts for dealing with UK post codes on the relevant page on the PHP site: http://www.php.net/manual/en/function.ereg.php HTH, Michael Egan -Original Message- From: Andy [mailto:[EMAIL PROTECTED] Sent: 02 April 2003 12:54 To: [EMAIL PROTECTED] Subjec