PHP连接变量
发布时间:2020-12-13 17:53:17 所属栏目:PHP教程 来源:网络整理
导读:对你们来说,这可能是一个简单的问题.在谷歌找不到它. 我试图连接两个变量名称; $i=0; for ($i=0;$i5;$i++){ if($array[$i]0){ $test.$i=//do something }else{ $test.$i=//do something }}//echo $test0 gives me nothing.//echo $test1 gives me nothing.
对你们来说,这可能是一个简单的问题.在谷歌找不到它.
我试图连接两个变量名称; $i=0; for ($i=0;$i<5;$i++){ if($array[$i]>0){ $test.$i=//do something }else{ $test.$i=//do something } } //echo $test0 gives me nothing. //echo $test1 gives me nothing. 我知道我不能使用$test.$i但不知道怎么做.任何帮助?谢谢!
尝试${$test.$i} = value
编辑:http://php.net/manual/en/language.variables.variable.php (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |