fork(2) download
  1. <?php
  2.  
  3. $fnc = 1;
  4. $linha = 2;
  5. $band = "a";
  6. $bandorc="a";
  7. $bandeira = "pt";
  8. echo "Exemplo com selected:\n";
  9. echo "<option value='premorc.php?fnc=$fnc&ans=$linha&bandorc=$band' ".($bandorc==$band?"selected":"").">$bandeira</option>";
  10.  
  11. $band = "b";
  12. echo "\n\nExemplo sem selected:\n";
  13. echo "<option value='premorc.php?fnc=$fnc&ans=$linha&bandorc=$band' ".($bandorc==$band?"selected":"").">$bandeira</option>";
  14.  
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
Exemplo com selected:
<option value='premorc.php?fnc=1&ans=2&bandorc=a' selected>pt</option>

Exemplo sem selected:
<option value='premorc.php?fnc=1&ans=2&bandorc=b' >pt</option>