在线等,把某个变量值当变量名怎么写? $data是JSON,已经解码。 现在问题是$week的值为1,如何调用$data[0]-d13。其中d+$week的值+'3' 怎么写?? 我用$$好像不行呀。 求解!! ------解决思路---------------------- $data=【本文来自鸿网互联 (http://www.
在线等,把某个变量值当变量名怎么写?
$data是JSON,已经解码。
现在问题是$week的值为1,如何调用$data[0]->d13。其中d + $week的值 + '3'
怎么写??
我用$$好像不行呀。
求解!!------解决思路----------------------$data = 【本文来自鸿网互联 (http://www.68idc.cn)】json_decode('[{"d13":123}]');<br />
$week = 1;<br />
echo $data[0]->{'d'.$week.'3'};<br />
<br />
123<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