vrmetro
asked on
PHP - Values not pulling out of array
Please see code below. $var['address'], etc does not work, can't figure out why.
Thank you!
Thank you!
function officeLocation($country) {
$var = array();
$var = $this->dealer_array;
if ($country == 'NL' || $country == 'DE') {
$location = ''.$this->dealer_name.'<br/>Leyenseweg 111c<br/>3721 BC Bilthoven<br/>The Netherlands<br/>
Phone +31(0) 30 229 30 04<br/>Fax +31(0) 30 274 00 74';
} else {
$location = ' '.$this->dealer_name.'<br/>
'.$var['address'].'<br/>
'.$var['phone'].'<br/>
'.$var['fax'].'<br/>';
}
return $location;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i'm an idiot! Was grabbing a deal that had no address/phone/etc.
Sorry.
Sorry.
>> Array ( [num] => 101 [name] => Omega GPS [address] => [phone] => [fax] => [countries] => US,BR,MX [vatnum] => [bcolor] => f6f2eb [acolor] => ebe1d1 [hcolor] => f6f2eb [rr1] => ebe1d1 [rr2] => fff [rr3] => e2e0e0 [rr_title_color] => a82f2b [image] => [s_image] => [instid] => 144954 )
address, phone and fax are all blank here...?
address, phone and fax are all blank here...?
:)
ASKER
I returned just the $var array and it's value is 1. I return $this->dealer_array(invoic
Now you think the dealer_array is simply not set prior to calling in officeLocation(), not true, I did
print_r($invoice->dealer_a
before calling $location = $invoice->officeLocation($
Array ( [num] => 101 [name] => Omega GPS [address] => [phone] => [fax] => [countries] => US,BR,MX [vatnum] => [bcolor] => f6f2eb [acolor] => ebe1d1 [hcolor] => f6f2eb [rr1] => ebe1d1 [rr2] => fff [rr3] => e2e0e0 [rr_title_color] => a82f2b [image] => [s_image] => [instid] => 144954 )
Thanks for your help!!!
Open in new window