Array keys, values
| From: | Christoph Boget | Date: | Mon, 15 Oct 2007 19:44:00 +0000 |
| Subject: | Array keys, values | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-13777@lists.php.net to get a copy of this message | ||
If I have an array that looks like this:
Array
(
[Salary] => Array
(
[0-50K] => Array
(
[filterType] => range
[fieldLabel] => 0-50K
[fieldName] => SALARY
[lowerValue] => 0
[upperValue] => 50
[inclusive] => LEFT
)
[50-70K] => Array
(
[filterType] => range
[fieldLabel] => 50-70K
[fieldName] => SALARY
[lowerValue] => 50
[upperValue] => 70
[inclusive] => BOTH
)
)
)
How can I access the key values? Individually, that is. What about the
child array key/values? Individually, that is. In the template, I've
tried:
{$myArray[0]}
{$myArray[0].filterType}
{$myArray[0][0]}
Nothing seems to work. I know how to iterate through the entire array and
display the contents that way, but I don't know how to get the key/value of
just one particular element (and/or any child arrays of that element).
Any help would be greatly appreciated!
thnx,
Christoph