Swapping values in PHP

in

It's always a good thing to search for something cool that you've found before blogging it, to make sure that others have not already done the same  It even helped me see a PHP trick that should be familiar to seasoned C/C++ programmers...

Oh, and for those who want to read it here as well, here's a one-liner to swap the values of two variables in PHP:

list($a, $b) = array($b, $a);

Trackback URL for this post:

http://ehsanakhgari.org/trackback/69

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.