动态的改变变量名称:
$varname=‘bookPrice‘; $$varname=5; //等价于 $bookPrice=5;
问了问别人说用于字符串拼接,先记下来:
$book=‘C++‘; $$book="10 yuan"; echo $book." ".${$book};
时间: 2024-11-08 10:31:23
动态的改变变量名称:
$varname=‘bookPrice‘; $$varname=5; //等价于 $bookPrice=5;
问了问别人说用于字符串拼接,先记下来:
$book=‘C++‘; $$book="10 yuan"; echo $book." ".${$book};