title: Get explode data to show in checkbox with others data
body: <p>I have string data in database table('fruit_select') like this </p>
  
  <pre><code>$fruit = "apple,orange,banana";
  </code></pre>
  
  <p>and i need to get all fruits in database table('fruits') like this</p>
  
  <p><code>$all_fruits = array('apple','banana','kiwi','melon','orange','watermelon');</code> </p>
  
  <p>to show in checkbox but if have fruit in table('fruit_select'), in checkbox need to checked. 
  How can i get all data to show with some data in table('fruit_select') to checked?</p>
  
  <p>this my view code to show all data</p>
  
  <pre><code>foreach ($all_fruits as $fruit){
     echo "&lt;label&gt;&lt;input type='checkbox' value='".$fruit."'/&gt;".$fruit."&lt;/label&gt;"; 
  }
  </code></pre>