Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这里我有一个单维数值数组
$x = array(1,2,3,4);
下面转换为对象数组
$x = (object) $x;
我无法通过索引访问值
echo $x->{'1'} //Tried but not working
从 echo 语句中的索引中删除引号:
$x = array(1,2,3,4); $x = (object) $x; echo $x->{1};
退货
2