一个比较难的问题 怎么循环读取变量的值

WBOY
Release: 2016-06-23 13:59:54
Original
1019 people have browsed it

在一个php文件里面有
变量1
变量2
也就是 $i1 $i2
然后我想用for 循环读取出来
for($x=1;$x //难题部分
}

php 不能在php里面修改变量的名称循环读取出来 
请问要怎么用for循环出php文件里面的$i1 $i2.. 要怎么循环出文件里面的变量


回复讨论(解决方案)

for($x=1;$x<=2;$x++){  echo ${'i' . $i};}
Copy after login
A123
请认真阅读手册

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template