Associative array access with space in key
| From: | Greg Dykema | Date: | Fri, 19 Apr 2002 05:35:54 +0000 |
| Subject: | Associative array access with space in key | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-3799@lists.php.net to get a copy of this message | ||
Greetings,
I've been through the manual and the mailing list archives, but I can't figure out how to make a reference to an associative array element whose key contains a space. For example, I've got an array with elements like
$a["Class ID"] = 1234;
I've tried { $a.Class ID } and { $a."Class ID" } but just get errors. References without spaces in the key work fine. Unfortunately the data structure is coming from a database access routine and I have no way of knowing what characters might be used in the keys.
Actually, the actual data structure is a combination of associative arrays and arrays, so the real references I'm making look like { $a.foo[0] }.
thanks,
greg