admin管理员组文章数量:1420220
I've the following array:
$test[$iterator][1][2]['name']
I have a function that needs to get $iterator
of that array when ['name'] == 'value';
So how can I use Javascript to get the given $iterator
?
Also, I did look at other questions, but I'm not sure if their answers apply to my question.
I've the following array:
$test[$iterator][1][2]['name']
I have a function that needs to get $iterator
of that array when ['name'] == 'value';
So how can I use Javascript to get the given $iterator
?
Also, I did look at other questions, but I'm not sure if their answers apply to my question.
Share Improve this question edited Jul 22, 2012 at 18:38 Jared Farrish 49.3k17 gold badges99 silver badges107 bronze badges asked Jul 22, 2012 at 18:33 AdolaAdola 5887 silver badges21 bronze badges 1-
PHP or JavaScript? The
$
seems a little strange. – Ry- ♦ Commented Jul 22, 2012 at 18:39
1 Answer
Reset to default 8Are you looking for something like this?
var $iterator;
for (var i = 0; i < $test.length; i++) {
if ($test[i][1][2]['name'] == 'value')
{
$iterator = i;
break;
}
}
本文标签: jqueryJavascript get key of multidimensional arrayStack Overflow
版权声明:本文标题:jquery - Javascript get key of multidimensional array - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745325527a2653573.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论