Posted By

petrafull on 02/24/10


Tagged

form if else short


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

alvincrespo


if/else shortform


 / Published in: PHP
 

  1. if($_POST['visible']==1) {
  2. $visible = 1;
  3. } else {
  4. $visible = 0;
  5. }
  6.  
  7. // equals:
  8.  
  9. ($_POST['visible']==1) ? $visible = 1: $visible = 0;

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Nanobyte on February 24, 2010

$visible = ($_POST['visible']==1) ? 1: 0;

You need to login to post a comment.