1 2 3 4 5 6 7 8 9 10 11 | <?php $a = 15; $b = 27; echo "交换前的数字是:"."a =".$a." and b=".$b; $temp = $a; $a = $b; $b = $temp; echo "<br>交换后的数字是:"."a =".$a." and b=".$b."\n"; |
1 2 3 4 5 6 | <?php $a = 15; $b = 276; echo "交换前:"."a=". $a . ',' ."b=". $b; list($a, $b) = array($b, $a); echo "<br>交换后:"."a=". $a . ',' ."b=". $b; |
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |