title: how to properly use implode() with associative arrays
body: <p>i have a question regarding the <a href="http://php.net/manual/en/function.implode.php" rel="nofollow"><code>implode()</code></a> in <code>php</code>, i have this <code>array()</code></p>
  
  <pre><code>$user_data = array(
      'user_id_num' =&gt; $_POST['userid'],
      'fullname' =&gt; $_POST['userfname'],
      'username' =&gt; $_POST['useruname'],
      'password' =&gt; $password_hash
  );
  </code></pre>
  
  <p>what i want to achieve is like this for example, </p>
  
  <p>for the fields</p>
  
  <pre><code>`user_id_num`,`fullname`,`username`,`password`
  </code></pre>
  
  <p>and for the values</p>
  
  <pre><code>'2159','Sample Name','example','mypassword' &lt;- hash password
  </code></pre>
  
  <p>what i have tried so far is this</p>
  
  <pre><code>$user_fields = '`' . implode('`, `', $user_data) . '`';
  $user_data   = '\'' . implode('\', \', $user_data) . '\'';
  </code></pre>
  
  <p>but i can't get what i want to achieve can someone help me with this? thanks in advance</p>