note 82500 added to control-structures.switch

From: Date: Mon, 14 Apr 2008 04:29:12 +0000
Subject: note 82500 added to control-structures.switch
Groups: php.notes 
Request: Send a blank email to php-notes+get-138287@lists.php.net to get a copy of this message
Hi,I want to use 2 language file,default is English and the second one is Bahasa. If user select other than English, it will load the language file, otherwise English will be default. My code is a below: <?php include('language/english.php'); $default_language = "English"; switch ($default_language){ case "Bahasa Melayu": include('language/bahasa.php'); break; } ?> How should I use the select statement? If I use dropdown, how do I pass the command to load the other language? I am beginner in PHP ---- Server IP: 124.217.231.13 Probable Submitter: 211.25.51.14 ---- Manual Page -- http://www.php.net/manual/en/control-structures.switch.php Edit -- https://master.php.net/note/edit/82500 Del: integrated -- https://master.php.net/note/delete/82500/integrated Del: useless -- https://master.php.net/note/delete/82500/useless Del: bad code -- https://master.php.net/note/delete/82500/bad+code Del: spam -- https://master.php.net/note/delete/82500/spam Del: non-english -- https://master.php.net/note/delete/82500/non-english Del: in docs -- https://master.php.net/note/delete/82500/in+docs Del: other reasons-- https://master.php.net/note/delete/82500 Reject -- https://master.php.net/note/reject/82500 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#138287) next »