Set checked checkbox from array : <p>I have 2 set of array which represent all data and selected data</p>

<pre><code>$all_data = ["admin","member","editor"];
$selected = ["admin","member"];
</code></pre>

<p>I want to make all list of data that have checked if $all_data value = $selected value
What the best method to make it possible?</p>
