How do you swap variables in PHP?

1 answer

Answer

1069612

2026-04-30 05:41

+ Follow

By using a third temporary variable.

$tmp = $a;

$a = $b;

$b = $tmp;

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.