var_dump help needed.

Posted by acctman on Stack Overflow See other posts from Stack Overflow or by acctman
Published on 2010-04-06T21:47:34Z Indexed on 2010/04/06 21:53 UTC
Read the original article Hit count: 310

Filed under:

The coding below seperates the $state data, I need help putting the var_dump info into $dat1 $dat2 and $dat3 where needed

if($en['country'] == 'US'){
   if ($_POST['locus'] == ''){$err .= 'Please select and fillin your locale.<br>';}
   $state = $_POST['locus']; // separate: NEW YORK, NY 10011
   preg_match("/(.*)\,\s+([A-Z]{2})\s+([\d]+)/", $state, $parts); 
   var_dump($parts);

} elseif($en['country'] == 'CA'){
   if ($_POST['locca'] == ''){$err .= 'Please select and fillin your locale.<br>';}
   $state = $_POST['locca']; // separate: PARADISE, NL A1L1P1
   preg_match("/(.*)\,\s+([A-Z]{2})\s+([\S]+)/", $state, $parts); 
   var_dump($parts);

} elseif($en['country'] == 'GB'){
   if ($_POST['locuk'] == ''){$err .= 'Please select and fillin your locale.<br>';}
   $state = $_POST['locuk']; // separate: LONDON, H9
   preg_match("/(.*)\,\s+([\S]{2})/", $state, $parts); 
   var_dump($parts); 
}

© Stack Overflow or respective owner

Related posts about php