I have the following PHP array:
$array = array("picture1"=>"item1", "picture2"=>"item2",
"picture3"=>"item3", "picture4"=>"item4");
I am trying to get the array values through this html code using jquery's .attr() method.
<td data-pictures="<?php echo json_encode($array); ?>"></td>
pictures = $(this).attr('data-pictures');
When I do a console log for the pictures variable, I am getting only a "{" and nothing more. Can someone help?
data-pictures="{"picture1":"item1",...}", so as you can see the string literal is terminated beforepicture1