Reputation: 64
I have the following array...generated from this code.
$aa = new_Arr();
print_r($aa); //here is the result...
cl_aa Object
(
[data:cl_aa:private] => Array
(
[t_a] => Array
(
[0] => Array
(
[f_c] => LAL
[p_r] => RN
[id] => 1214125
[gender] => m
)
)
[t_b] => Array
(
)
[t_l] => Array
(
[0] => Array
(
[p_lev] => 2
[p_date] =>
[p_r] =>
)
)
[t_r] => Array
(
[0] => Array
(
[I_r] => 19
)
)
)
[db:cl_aa:private] => PDOTester Object
(
)
)
I try to read it as like this...
foreach ($aa as $key=>$value) {
print_r($key);
echo "<h1>". $value['bb']. "</h1>";
}
but no result i can see...
how do I read the above array? Help please?
Upvotes: 0
Views: 74
Reputation: 8508
Provide your cl_aa
class some getters :
public class cl_aa {
private $data;
private $db;
public function getData() {
return $this->data;
}
public function getDb() {
return $this->db;
}
}
And to access your data from outside :
$aa = new_Arr(); // I assume this function returns a cl_aa object.
print_r($aa->getData());
print_r($aa->getDb());
Take a look at this link to learn more about OOP.
Upvotes: 1