21e6
| |||||||||||
| |||||||||||
|
Trouble pulling data using reg exp. Posted by Chris_Isaac (Chris Isaac), 16 June 2003 HiI'm trying to pull out the County out of out of an address field ($addy). I can get either the town and county together or the county and postcode. I tried to do another reg exp on the result of the 2nd option above, but it just prints out 'Array'. Any ideas please?? Chris Code:
Posted by admin (Graham Ellis), 16 June 2003 This code:Code:
on similar (?) address data gave me ouput including ... Quote:
My addresses had comma separated lines and I've assumed that the chunk before the postcode was the county. In practice, the county was missing on some of the data and I got towns such as "Bath" reported back for a few counties. HOWEVER - it's the program you're really looking at. I've pub (extra) round brackets around the county, and I've referred to $gotten[1] for the first bracket match and $gotten[2] for the second bracket match. $gotten[0] would refer to the whole match string (not of any interest to me) and $gotten just says "Array". By the way - NO SPACE between $gotten and [1] within double quotes - if you do, it says Array [1] .... Posted by Chris_Isaac (Chris Isaac), 16 June 2003 Thanks, thats cured it!This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||