Associative array question
| From: | Alain Fontaine | Date: | Mon, 10 Jun 2002 16:35:25 +0000 |
| Subject: | Associative array question | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-4731@lists.php.net to get a copy of this message | ||
Hello!
I have an array like this:
$arrTypes = array("A" => "Appartement", "M" =>
"Maison");
I assign this array to the template:
$Smarty->Assign("arrTypes", $arrTypes);
Now I'd like to display the value of one particular key-value pair, and the
key is stored in another variable. Manually, I can do:
{$arrTypes.A}
to display "Appartement".
What is the syntax if "A" or "M" are themselves values of another Smarty
variable?
Thanks!
---
Alain Fontaine
VAlain sa