I have this addAddress function call (see function below). The address value gets passed in, but I need to get the $htmlmessage out from the function which isn't currently being returned because I need to check for a 620 error code.
$map->addAddress($value);
How do I get the $htmlmessage parameter from the addAddress function? There is an $htmlmessage for invalid points and well as validpoints?
Would it be:
$htmlMsg-> invalidpoints[$htmlmessage]
Or do I need to add a return $htmlmessage from the function before the last parenthesis? In that case, since I am already calling the $map ->addAddress($value) to input the address, how can I call it the second time to get the returned value? I think I should check the invalidpoints and the validpoints $htmlmessage.
thanks,
function addAddress($address,$htmlMessage=null){
if (!is_string($address)){
die("All Addresses must be passed as a string");
}
$addressData = file_get_contents($apiURL.urlencode($address));
$results = $this->xml2array($addressData);
if (empty($results['ResultSet']['Result']['Address'])){
$pointer = count($this->invalidPoints);
$this->invalidPoints[$pointer]['lat']= $results['ResultSet']['Result']['Latitude'];
$this->invalidPoints[$pointer]['long']= $results['ResultSet']['Result']['Longitude'];
$this->invalidPoints[$pointer]['passedAddress'] = $address;
$this->invalidPoints[$pointer]['htmlMessage'] = $htmlMessage;
}else{
$pointer = count($this->validPoints);
$this->validPoints[$pointer]['lat']= $results['ResultSet']['Result']['Latitude'];
$this->validPoints[$pointer]['long']= $results['ResultSet']['Result']['Longitude'];
$this->validPoints[$pointer]['passedAddress'] = $address;
$this->validPoints[$pointer]['htmlMessage'] = $htmlMessage;
}
}