Forum Moderators: coopster
im pushing some xml to a clients supplier and it was failing and we tracked it down to the postcode. they need to have the postcode broken up. for example
SW1A 2AA
and not
SW1A2AA
but also dont want to end up with 2 spaces either
SW1A 2AA
i have an idea using substr and putting it into 2 variables trim any whitespace and then adding a space between the 2
Just wanted to run it by here first if anyone has a better idea or if anyone wants to knock it as a lame idea :p
thanks in advance
One is in the form of a regular expression. If you look at the wikipedia page for uk postcodes, they give a nice regular expression for you: [en.wikipedia.org...]
The other comes within the PEAR package. What do you know, they have a function specifically for validating uk postcodes: Validate_UK [pear.php.net].