title: Wordpress Inserting multiple checkbox values using implode
body: <p>I'm trying to insert the values of my check box into the database using this code, its working but the only data that is entering the data base is the value of the last checkbox that I clicked</p>
  
  <p><strong>Form elements:</strong></p>
  
  <pre><code>&lt;input type="checkbox" value="football" name="sports[]"&gt;Football
  &lt;input type="checkbox" value="running" name="sports[]"&gt;Running
  &lt;input type="checkbox" value="triathlon" name="sports[]"&gt;Triathlon
  </code></pre>
  
  <p><strong>PHP:</strong></p>
  
  <pre><code>if(isset($_POST['submit'])) {
       global $wpdb;
         $sports =$_POST['sports'];
         foreach ( $sports as $sportt) {
             $sportt;
             }
         $array = array($sportt); 
         $sport = implode(',',$array);
             }
         $wpdb-&gt;insert( 
                'user_profile', 
                 array(
                'sports' =&gt; $sport));
  </code></pre>