faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

0 of 1 people (0%) answered Yes
Recently 0 of 1 people (0%) answered Yes

Entry

Making a third option in this code ($gender == "1" ? L_REG_46 : L_REG_47); i want to make 3 L_REG_48

Mar 15th, 2008 18:07
ha mo, Scott Noyes, Brandon _, http://www.php.net/switch


Don't, it would be unreadable.  Use a switch statement instead:
switch($gender) {
  case '1': echo L_REG_46; break;
  case '2': echo L_REG_47; break;
  case '3':
  default:
    echo L_REG_48; break;
}
http://www.tantofa.com
http://www.fantofa.com
http://www.mantofa.com
http://www.tanpola.com
http://www.tampola.com
http://www.mozmar.com
http://www.yamot.com
http://www.templatestemp.com