I've been fooling off with preg_replace because I don't have a clear understanding of the regex. I've read php.net etc but I can't find some of the unique identifiers that I see other people using like i/.
I remembered an old script I gave up on and though since it was similar I should give it another shot.
This is basically pulling a text file from google maps to find the zip code. I don't really want to parse the xml and so I thought preg_match would be much simpler. haha for me, I suck at regex!
$geocode = file_get_contents("http://maps.google.com/maps/geo?q=".
$address_url . '&key=' . $google_key);
$g_pattern = '/"PostalCodeNumber" : "(.*?)"/';
preg_match($g_pattern, $geocode, $zip);
The above result for $zip is "1", which means I have a bit further to go. How do I fix this or do you know of any unique identifiers, maybe a detailed library?
This is an example address I pulled off Google to show you what data is being looked at: Example You'll need to click "go" or press [Enter] in your web-browsers url line for the feed to show up.