fork download
  1. <?php
  2.  
  3. $orange = 1;
  4. $apple = 0;
  5. $peach = 1;
  6. $berry = 0;
  7.  
  8. $stdArray1 = array();
  9. $stdArray2 = array();
  10.  
  11. $stdArray1 ['1'] = $orange;
  12. $stdArray1 ['2'] = $apple;
  13. $stdArray1 ['3'] = $peach;
  14. $stdArray1 ['4'] = $berry;
  15. $stdArray2 ['1'] = 'Flordia';
  16. $stdArray2 ['2'] = 'Washington';
  17. $stdArray2 ['3'] = 'Georgia';
  18. $stdArray2 ['4'] = 'Oregon';
  19.  
  20. $fruit = "";
  21.  
  22. foreach ($stdArray1 as $index => $value) {
  23. if ($value == '0') {
  24. $fruit .= $stdArray2[$index] . ", ";
  25. }
  26. }
  27.  
  28. echo $fruit;
  29.  
Success #stdin #stdout 0.04s 23068KB
stdin
Standard input is empty
stdout
Washington, Oregon,