Home >Backend Development >PHP Tutorial >关于两个$$数组有关问题

关于两个$$数组有关问题

WBOY
WBOYOriginal
2016-06-13 12:25:34891browse

关于两个$$数组问题

本帖最后由 u013366173 于 2015-10-10 11:35:49 编辑
<br />$jian2015="arr";<br />$arr=array();<br />$$jian2015[]=1;<br />print_r($arr);<br /><br />

想给数组递增,上面$$jian2015[]=1;写法不行,提示错误

Fatal error: Cannot use [] for reading in D:\WWW\nshop\5.php on line 35


这个怎么解决呢
------解决思路----------------------
$jian2015="arr";<br />$arr=array();<br />array_unshift($$jian2015, 1);<br />print_r($arr);<br />
Statement:
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