I have an array in php I pull into my jquery like so:
var hide = <?php echo json_encode($user_dashboard); ?>;
this give me:
var hide = "a:2:{i:0;s:18:\"dashboard-progress\";i:1;s:19:\"dashboard-bookmarks\";}";
I had some code that working fine when the array was just a string but now it doesnt compare the elements:
if ( $.inArray( $this.attr('id') , hide) != -1 )
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:
var hide = "dashboard-progress", "dashboard-bookmarks";
It worked fine. But now I have to store the array in php and MySQL.
var_dump($user_dashboard)
contains string(67) "a:2:{i:0;s:18:"dashboard-progress";i:1;s:19:"dashboard-bookmarks";}"
The data is pulled from an array being put into MySQL field using php serialize.