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.
Are 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;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With