Don't try to mix creating your own json strings
$objJSON = array('sample' => null);
// whatever
$objJSON['sample'] = $arr;
$objJSON = json_encode($objJSON);
echo '<script type="text/javascript">var myJSON = ' . $objJSON . ';</script>
Last edited by ShawnCplus; Sep 2nd, 2009 at 4:13 pm.
Reputation Points: 520
Solved Threads: 268
Code Monkey
Offline 1,564 posts
since Apr 2005