ajsie
ajsie

Reputation: 79686

array_key_exists, array_search, in_array doesnt apply to multidimensional array?

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)

Upvotes: 0

Views: 748

Answers (1)

Yacoby
Yacoby

Reputation: 55445

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.

Upvotes: 4

Related Questions