acctman Posted April 6, 2010 Share Posted April 6, 2010 I have 3 questions 1. how do I use the var_dump($parts); code to set $city $state $zip. 2. using the same similar code I need to change the preg_match to separate "London, H9" 3. using the same similar code I need to change the preg_match to separate "PARADISE, NL A1L1P1" thanks in advance. $uscountry = $_POST['locus']; // New York, NY 10011 preg_match("/(.*)\,\s+([A-Z]{2})\s+([\d]+)/", $uscountry, $parts); var_dump($parts); Quote Link to comment Share on other sites More sharing options...
JAY6390 Posted April 6, 2010 Share Posted April 6, 2010 This will assign the part to a variable $variable = $parts['array_key_here']; Quote Link to comment Share on other sites More sharing options...
acctman Posted April 6, 2010 Author Share Posted April 6, 2010 This will assign the part to a variable $variable = $parts['array_key_here']; what would the array_key be? can you help me with all 3 of my questions. I've been at this for the past 2hrs. I want to get this completed so I can work on something else. thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.