可变变量名

<?php
$name="apple";
$$name=5;
echo $name." and ".$$name;
?>

结果:apple and 5

原文地址:https://www.cnblogs.com/4php/p/3382169.html