Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

ive got an array like this:

$display_related_tags[0][20] = 'text1';
$display_related_tags[1][21] = 'text2';
$display_related_tags[2][22] = 'text3';

i want to either check if value (text1) exists or if key (20) exists but the mentioned array functions just apply to one dimensional arrays.

what are my alternatives without having to use loops (it will be too heavy then)

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

what are my alternatives without having to use loops (it will be too heavy then)

You don't have any other options that to loop (at some level) over the first dimension. The only other way would be to restructure your data.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.