对你们来说,这可能是一个简单的问题.在谷歌找不到它.
我试图连接两个变量名称;
- $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