Code: Select all
$cust_contact = array();
$cust_contactї"name"] = "My Name";Then I pass that array into a constructor of my Email class:
Code: Select all
class Email {
var $info = array();
function Email($cust_info) {
$this->$info = $cust_info;
print_r($cust_info);
echo("<br>");
print_r($this->$info);
echo("<br><br>name= ".$cust_info{"name"});
echo("<br>name= ".$this->$info{"name"});
}//constructor
}//classI have printed out the structure of the each array as well as the values in each array above. Here is the output:
Code: Select all
Array ( їname] => My Name )
Array ( їname] => My Name )
name= My Name
name= ArrayIf both arrays have the same structure ( [name] => My Name ), and I am accessing the values of those arrays in the exact same way ( name= ".$cust_info{"name"}); ), why don't they both print out "My Name" as the value instead of "Array"?
Thanks