I have PHP array like this :

```
Array ( [1631196322] => 
                <div id="area_'.$randId.'">
                    <table id="table_'.$randId.'" contenteditable="true" '.$tableContent.'
                    </table>
                </div> 
        [16865437] => a16865437 );

```

I convert it into JSON :

```
{"1631196322" : "<div id="area_'.$randId.'">
                    <table id="table_'.$randId.'" contenteditable="true" '.$tableContent.'
                    </table>
                </div>",
"16865437" : "a16865437" }

```

Than I call Javascript function

```
<?php
$tables = json_decode($table);
foreach ($tables as $key => $value) {
    echo '<button onclick="tampilisi('.$key.')">Tombo '.$key.'</button>';
}
?>
<div id='display'></div>

<script type="text/javascript">
    function tampilisi(isi){
        var txt = '<?php echo $table;?>';

        var data = JSON.parse(txt);

        datai = data[isi];
        $('#display').text(datai);
    }
</script>

```

I got error because the JSON containing HTML. If I change the JSON data into this :

```
{"1631196322" : "aaaaaaaaa",
    "16865437" : "a16865437" }

```

It has no problem, so I think I can't using JSON in this case. What solution do you thing that I must to do?