How to compare two array in php
<pre><code>while($row = $update_post-&gt;fetch_array()){
                        //Explodes checkbox values
                        $res = $row['column_name'];
                        $field = explode(",", $res);

                        $arr = array('r1','r2,'r3','r4','r5','r6');

                            if (in_array($arr, $field)) {
                                echo "&lt;script&gt;alert('something to do')&lt;/script&gt;";
                            }else{
                                echo "&lt;script&gt;alert('something to do')&lt;/script&gt;";
                            }
    }
</code></pre>

<p>How to check if value of $arr is equal to the value of $field.</p>

<p>Thank you in Advance.</p>