Split PHP Variable Value - Help
Right guys i need some help and I've been thinking about this for some time and cant come up with a way round the issue. I have a form which consumers fill in, they need to enter their UK Post Code. Now i need to send that info onto our client but they require the postcode be sent in 2 strings. For example:
Now there's different formats a UK Post Code can be:
As you can see the different formats, now the issue i have is how do i go about working out where I should split the postcode value? The obvious thing for me to do would be to ask people to enter their first part and second part of their postcode in 2 different fields but I don't really want to do it that way as it may confuse consumers.
Format Example Coverage
A9 9AA M1 1AA B, E, G, L, M, N, S, W postcode areas
A99 9AA B33 8TH
AA9 9AA CR2 6XH All postcode areas except B, E, G, L, M, N, S, W, WC
AA99 9AA DN55 1PT
A9A 9AA W1A 1HQ E1W, N1C, N1P, W1 postcode districts (high density areas where codes ran out)
AA9A 9AA EC1A 1BB WC postcode area; EC1–EC4, NW1W, SE1P, SW1 postcode districts (high density areas where codes ran out)
Can anyone help me out please?