View Single Post
  #3 (permalink)  
Old 04-09-2008, 01:31 PM
dman_2007
Guest
 
Posts: n/a
iTrader: / %
Default

Another good method, a bit more involved but gets the job done. Here's another method using ^ (XOR) operator :

Code:
<?php
  $a = 10;
  $b = 20;
  
  echo '$a => ' , $a, ' $b => ', $b, '<br />';
  
  $a = $a ^ $b;
  $b = $a ^ $b;
  $a = $a ^ $b;
  
  echo '$a => ' , $a, ' $b => ', $b, '<br />';
?>
Reply With Quote