inject object array
Posted: Wed Dec 15, 2004 6:46 pm
Oke
i get an array back from a class [ query from db ]
the returned array looks kinda like this
Array ( [0] => stdClass Object ( [id] => 1 [name] => birdy [link] => birdy ect..
That array i am injecting into another class again.
than the function in that class:
This will return a value but only the last or the first value of the array. It should be all of them.
if i would skip the whole foreach thing. and return $myarray it will return a object array again. the same as it got injected into the function.
Array ( [0] => stdClass Object ( [id] => 1 [name] => birdy [link] => birdy ect..
So what am i missing here !?
i get an array back from a class [ query from db ]
the returned array looks kinda like this
Array ( [0] => stdClass Object ( [id] => 1 [name] => birdy [link] => birdy ect..
That array i am injecting into another class again.
than the function in that class:
Code: Select all
function _downloads( &$myarray ) {
foreach ($myarray as $retarray) {
$ret = $retarray->name;
}
return $ret;
}if i would skip the whole foreach thing. and return $myarray it will return a object array again. the same as it got injected into the function.
Array ( [0] => stdClass Object ( [id] => 1 [name] => birdy [link] => birdy ect..
So what am i missing here !?