title: jquery check if inArray from php array
body: <p>I have an array in php I pull into my jquery like so:</p>
  
  <pre><code>var hide = &lt;?php echo json_encode($user_dashboard); ?&gt;;
  </code></pre>
  
  <p>this give me:</p>
  
  <pre><code>var hide = "a:2:{i:0;s:18:\"dashboard-progress\";i:1;s:19:\"dashboard-bookmarks\";}";
  </code></pre>
  
  <p>I had some code that working fine when the array was just a string but now it doesnt compare the elements:</p>
  
  <pre><code>if (  $.inArray( $this.attr('id') , hide) !=  -1 )
  </code></pre>
  
  <p>basically its just testing to group of elements ID's against the array. If the array contains the ID then doing something. When the array was just:</p>
  
  <pre><code>var hide = "dashboard-progress", "dashboard-bookmarks";
  </code></pre>
  
  <p>It worked fine. But now I have to store the array in php and MySQL. </p>
  
  <p><code>var_dump($user_dashboard)</code> contains <code>string(67) "a:2:{i:0;s:18:"dashboard-progress";i:1;s:19:"dashboard-bookmarks";}"</code></p>
  
  <p>The data is pulled from an array being put into MySQL field using php serialize. </p>