Posted By

mscribellito on 07/07/11


Tagged


Versions (?)

Swap


 / Published in: PHP
 

  1. <?php
  2.  
  3. function swap(&$a, &$b) {
  4. $t = $b;
  5. $b = $a;
  6. $a = $t;
  7. }
  8.  
  9. $hello = "world!";
  10. $world = "Hello, ";
  11.  
  12. swap($world, $hello);
  13.  
  14. echo $hello . $world;

Report this snippet  

You need to login to post a comment.