[英]Accessing a 3d array without using foreach loop
Let's say I have a 3D array and I don't want to access it through the key names. 假设我有一个3D数组,但我不想通过键名访问它。
Is there a way to access to the value (2) without having to use a foreach
loop? 有没有一种方法可以访问值(2),而不必使用
foreach
循环?
array (size=1)
'type' =>
array (size=1)
'registered' => string '2' (length=1)
It is not possible without a loop. 没有循环就不可能。
You could try serializing your array and working with the serialized structure. 您可以尝试序列化阵列并使用序列化的结构。 Not saying this is good or even viable, but it might do what you want.
并不是说这是好的甚至是可行的,但是它可能会做您想要的。
You can find out more about serialize here: http://php.net/manual/en/function.serialize.php 您可以在此处找到有关序列化的更多信息: http : //php.net/manual/en/function.serialize.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.