开发者

array_key_exists, array_search, in_array doesnt apply to multidimensional array?

开发者 https://www.devze.com 2022-12-15 03:27 出处:网络
ive got an array like this: $display_related_tags[0][20] = \'text1\'; $display_related_tags[1][21] = \'text2\';

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)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消