[PHP] So many functions!
Hello, There so many functions in php that I can't find the one I need. I have a table like that: $lang[english][category]= Category ; $lang[english][backpage]= Go to the back page ; $lang[english][nextpage]= Go to the next page ; ... $lang[francais][category]= Catégorie ; $lang[francais][backpage]= Aller à la page précédente ; $lang[francais][nextpage]= Aller à la page suivante ; ... And I need to extract english and francais. As it, when I will add another language such as espanol, it will be automatic... Any idea ? Thanks, Vincent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] So many functions!
What I would do is first read a cookie that you set on the clients machine that follows the accept language guidelines.. so just the first two letters then if that is not set, then take the browsers languages $HTTP_ACCEPT_LANGUAGE and use them. So instead of english you would have 'en', espanol = 'es', german = 'de' $lang[en][category] So you just take that one variable and it will know which array to use.. Cheers! Rick He who draws noble delights from the sentiments of poetry is a true poet, though he has never written a line in all his life. - George Sand From: Vincent M. [EMAIL PROTECTED] Date: Wed, 02 Apr 2003 16:58:06 -0500 To: [EMAIL PROTECTED] Subject: [PHP] So many functions! Hello, There so many functions in php that I can't find the one I need. I have a table like that: $lang[english][category]= Category ; $lang[english][backpage]= Go to the back page ; $lang[english][nextpage]= Go to the next page ; ... $lang[francais][category]= Catégorie ; $lang[francais][backpage]= Aller à la page précédente ; $lang[francais][nextpage]= Aller à la page suivante ; ... And I need to extract english and francais. As it, when I will add another language such as espanol, it will be automatic... Any idea ? Thanks, Vincent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] So many functions!
Vincent M. wrote: Hello, There so many functions in php that I can't find the one I need. I have a table like that: $lang[english][category]= Category ; $lang[english][backpage]= Go to the back page ; $lang[english][nextpage]= Go to the next page ; ... $lang[francais][category]= Catégorie ; $lang[francais][backpage]= Aller à la page précédente ; $lang[francais][nextpage]= Aller à la page suivante ; ... And I need to extract english and francais. As it, when I will add another language such as espanol, it will be automatic... Any idea ? Try while(list($key, $val) = each($lang)) { echo $key. : .$val; } -- Burhan Khalid phplist[at]meidomus[dot]com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] So many functions!
Try $languages = array_keys($lang); This will create an array $languages = array(english,francais); Matt - Original Message - From: Vincent M. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 4:58 PM Subject: [PHP] So many functions! Hello, There so many functions in php that I can't find the one I need. I have a table like that: $lang[english][category]= Category ; $lang[english][backpage]= Go to the back page ; $lang[english][nextpage]= Go to the next page ; ... $lang[francais][category]= Catégorie ; $lang[francais][backpage]= Aller à la page précédente ; $lang[francais][nextpage]= Aller à la page suivante ; ... And I need to extract english and francais. As it, when I will add another language such as espanol, it will be automatic... Any idea ? Thanks, Vincent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php