Arrays & Keys?
| From: | John Taylor-Johnston | Date: | Thu, 25 Mar 2004 05:17:53 +0000 |
| Subject: | Arrays & Keys? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-181446@lists.php.net to get a copy of this message | ||
Am I doing this right? Is there a better way? Am I doing this key thing right?
I'm doing the language thing. I have no extra plugins or rpms to help do this
properly. So I need advice. Is this going to work? I'm trying to make sense of
http://www.php.net/manual/en/language.types.array.php
$date = getdate(mktime(0,0,0,$month_now,1,$year_now));
$month_name = $date["month"];
$month_array = array("January" => "Janvier",
"February" => "Février",
"March" => "Mars",
"April" => "Avril",
etc ...
);
-snip-
Therefore:
-snip-
if ($lang == "french")
{
echo $month_array[$month_name]; // Should echo the current month: "Mars"?
}else{
echo "$month_name";
}
Am I doing this right? Is there a better way? Am I doing this key thing right?
Still trying to learn :)