At 01:47 09.03.2003, John Taylor-Johnston said:
--------------------[snip]--------------------
>New at this, somewhat:
>
><?php
>#http://www.php.net/manual/en/ref.array.php
>$EricCodesArray = array (
> "CO" => "Description", "Input Name", "Select Name", "Option Name",
>"Option Selected",
> "AN" => "ERIC Number", "EricAN", "SelAN", "AN", "AN �Annotation�",
> "TI" => "Title", "EricTI", "SelTI", "BT", "BT �Book Title�"
>);
This won't run I believe...
Code it like this:
$EricCodesArray = array (
"CO" => array("Description", "Input Name", "Select Name", "Option Name",
"Option Selected",),
"AN" => array("ERIC Number", "EricAN", "SelAN", "AN", "AN �Annotation�",),
"TI" => array("Title", "EricTI", "SelTI", "BT", "BT �Book Title�",),
);
Then you may reference an element within a subarray:
echo $EricCodesArray['TI'][2]; //should display "SelTi"
Note that non-numeric array indices (a.k.a. associative arrays)
a) should always be quoted, and
b) are case sensitive.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php