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;
}
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745325527a4622638.html
评论列表(0条)