php multidimensional array if loop

Posted by user1091558 on Stack Overflow See other posts from Stack Overflow or by user1091558
Published on 2012-12-14T17:01:34Z Indexed on 2012/12/14 17:03 UTC
Read the original article Hit count: 161

I have a multidimensional array like this

array[value][1][1]

Now i would like to implement if loop like this

if ($value = array[value][1][1]) {
echo "It works";
} 

Now it works if i assign the values like [1][1],[2][1].

Is it possible to compare the whole array.

I mean if the array looks like

array[value][1][1],array[value][2][1],..........,array[value][n][1]

It works should be echoed.

I tried like this.

if ($value = array[value][][]) {
echo "It works";
} 

But its not working. Can anyone give me the correct syntax?

© Stack Overflow or respective owner

Related posts about if-statement

Related posts about multidimensional-array