Fwd: [PHP] dealing with this code $_POST['custom´]

From: Date: Sat, 17 Dec 2011 13:27:22 +0000
Subject: Fwd: [PHP] dealing with this code $_POST['custom´]
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-316051@lists.php.net to get a copy of this message
Just forwarding Carlos' response to the list... ---------- Forwarded message ---------- From: Carlos Sura <carlos.sura1@googlemail.com> Date: 17 December 2011 01:15 Subject: Re: [PHP] dealing with this code $_POST['custom´] To: Marc Guay <marc.guay@gmail.com> On 16 December 2011 15:57, Marc Guay <marc.guay@gmail.com> wrote: > > > $saving_list = $_POST['custom'] == 'FR' ? 148 : 147; > > Hi there, here's a quick translatation of this code that might help > you understand it better: > > if ($_POST['custom'] == 'FR'){ >  $saving_list = 148; > } > else{ >  $saving_list = 147; > } Hello, Thank you both for answer me. Also I would like to thank you Marc Guay, because with your answer I figured out how to do it. My code is like this: //$saving_list = $_POST['custom'] == 'FR' ? 148 : 147;   if ($_POST['custom'] == 'FR'){                 $saving_list = 148;                }   if ($_POST['custom'] == 'EN'){                 $saving_list = 147;                }  else{  $saving_list = 152;  } I'm not sure if that's the best way, but it is working for me as I expected, althought any other recommendation would be great. Regards -- Carlos Sura.- www.carlossura.com

« previous php.general (#316051) next »