Referencing an array?
Posted: Wed Nov 26, 2003 5:21 pm
Hi there ...
I'm wondering how I can do this in PHP...
If I create an array such as this:
$dow[1] = "Monday";
$dow[2] = "Tuesday";
...
And I have a SQL database which contains the number 1 in another array, $row["id"], how can I get it to reference Monday?
I tried $dow[$row["name"]] but that doesn't work.
Thanks,
Peter.
I'm wondering how I can do this in PHP...
If I create an array such as this:
$dow[1] = "Monday";
$dow[2] = "Tuesday";
...
And I have a SQL database which contains the number 1 in another array, $row["id"], how can I get it to reference Monday?
I tried $dow[$row["name"]] but that doesn't work.
Thanks,
Peter.