fork download
  1. <?php
  2.  
  3. $wheres[] = 'SELECT * FROM x';
  4. $wheres[] = 'SELECT * FROM y';
  5. $wheres[] = 'SELECT * FROM z';
  6.  
  7. $wheres_compiled = implode(' UNION ', $wheres);
  8.  
  9. var_dump($wheres_compiled);
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
string(59) "SELECT * FROM x UNION SELECT * FROM y UNION SELECT * FROM z"