Home > Backend Development > PHP Tutorial > 一个比较难的有关问题 如何循环读取变量的值

一个比较难的有关问题 如何循环读取变量的值

WBOY
Release: 2016-06-13 11:52:54
Original
1013 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++){<br />  echo ${'i' . $i};<br />}
Copy after login
A123
请认真阅读手册

Related labels:
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