<?php $result = 'val01\test\val04'; //these are the data that are get from DB $example = ['testData' => $result]; $json = json_encode($example); $javascript = json_encode($json); ?> <script> var json = <?php echo $javascript; ?>; var obj = JSON.parse(json); </script>
You have javascript disabled. You will not be able to edit any code.