Swap 2 Variables
// swap 2 variables without using temporary variable
<?php
$a = 10;
$b = 20;
list($a, $b) = array($b, $a);
?>
Posted on 2008-10-17 20:19 | By: ferdhie | Tags: php | 0 Comments
// swap 2 variables without using temporary variable
<?php
$a = 10;
$b = 20;
list($a, $b) = array($b, $a);
?>
Embed Snippet:
0 Comments