public function doenroll($phone = null){
static $code = 5050;
if($phone != null){
$text = null;
$code = rand(1111, 9999);
}
在if里面对$code赋值 上面的static $code的值并不会变,这是为什么,如果在if里面要修改
static $code
的值怎么办
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
找到问题了 赋值是没有错的 是if没进去