Home > Backend Development > PHP Tutorial > 请问一个有关问题,怎么将两个变量“粘”在一起

请问一个有关问题,怎么将两个变量“粘”在一起

WBOY
Release: 2016-06-13 11:49:31
Original
920 people have browsed it

请教一个问题,如何将两个变量“粘”在一起?

本帖最后由 fengkuangfashi38 于 2014-02-27 21:02:31 编辑 是指变量名“粘”在一起,怎么描述好呢……


例如有一些变量分别叫 $a1 $a2 $a3

我想要

for (i=0;i
怎么办呢 

不要用数组……
------解决方案--------------------
$a1=1 ;<br />$a2=2 ;<br />$a3=3;<br /><br />for ($i=0;$i<3;$i++) echo ${'a'.($i+1)}.PHP_EOL;
Copy after login

1
2
3
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