Passing objects as a reference and extracting the index of an associative array.
| From: | Webmaster | Date: | Thu, 04 Sep 2003 13:30:51 +0000 |
| Subject: | Passing objects as a reference and extracting the index of an associative array. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-161648@lists.php.net to get a copy of this message | ||
Hi,
i am using the smarty template engine.
Here is the problem that I would like to ask about:
function initTop(&$page, $array)
{
for ($i=0; $i<sizeof($array)
{
$page->assignVars(, $array[$i])
}
}
The function is supposed to know which object's attributes she is supposed
to change. Do I have to pass the object as a reference? Have never worked
with References before.
The array is supposed to be associative.
The funcion assignVars() is called like this:
$objektname->assignVars("indexname of ass. array", $arraywert);
How do I get the indexname for each arrrayvalue, so I can pass it to the
function assignVars?
Is there a php function?
Thank you very much.