获取一个值出在PHP序列化数组 [英] Getting one value out of a serialized array in PHP
本文介绍了获取一个值出在PHP序列化数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你会怎么说是最有效的方式来得到一个值超出数组。我知道它是什么,我知道它在哪里。目前,我与做:
What would you say is the most efficient way to get a single value out of an Array. I know what it is, I know where it is. Currently I'm doing it with:
$array = unserialize($storedArray);
$var = $array['keyOne'];
不知道是否有更好的方法。
Wondering if there is a better way.
推荐答案
您正在做的很好,我想不出比你在做什么更好的办法。
You are doing it fine, I can't think of a better way than what you are doing.
- 您反序列化
- 您得到一个数组
- 您通过指定索引获得价值
这是可以做到的方式。
这篇关于获取一个值出在PHP序列化数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文