title: How do i pass serialize data by PHP in mysql and unserialize to jquery ajax?
body: <p>Database</p>
  
  <pre><code>**username**
  admin
  
  **ref**
  a:2:{i:0;s:5:"Facebook";i:1;s:6:"Forum";}
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>$query = "SELECT * FROM users WHERE username='admin'";
  echo json_encode($query);
  </code></pre>
  
  <p>how can i unserialize Ref and pass to echo json_encode($query); ?</p>