如何获取数组中的第一个值 [英] How to fetch the 1st value in array
本文介绍了如何获取数组中的第一个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个关联的数组。
例如:$ ma_name ['name'];有3个值我可以使用打印来检查。
我的问题是当我在循环中运行这个数组时如何单独获得第一个值。
我试过这个; $ ma_name [0] [名称];我将输出作为输出的第一个字母。
I've an array which is associative.
For eg: $ma_name['name'];has 3 values which I can check using printing it.
My question is how to get the 1st value alone when I run this array in loop.
I tried this; $ma_name[0]['name']; which I get the output as 1st letter of the output.
推荐答案
ma_name ['name'];有3个值我可以使用打印来检查。
我的问题是当我在循环中运行这个数组时如何单独获得第一个值。
我试过这个;
ma_name['name'];has 3 values which I can check using printing it.
My question is how to get the 1st value alone when I run this array in loop.
I tried this;
ma_name [0] ['name'];我把输出作为输出的第一个字母。
ma_name[0]['name']; which I get the output as 1st letter of the output.
你可以参考这个
get-first-element-of-an-array [ ^ ]
You can refer this
get-first-element-of-an-array[^]
这篇关于如何获取数组中的第一个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文