here I chose the key lines from the code, which shows how both arrays are formed:

something here is buggy function insert the code, does not insert normally, here is the link: http://mysticpaste.com/view/wcfs0yKMfl?11 (here the text)

if you output both in javascript, the result will be as follows:

"[[1, \" one \ ", \" test \ "], [2, \" two \ ", null], [3, \" three \ ", null], [4, \" four \ " , \ "temp \"]] "

[[1, "one", "test"], [2, "two", "null"], [3, "three", "null"], [4, "four", "test2"]]

why in the first case the whole array is in quotes (as well as the screening inside) and how to remove it all, what would be the second option?

    1 answer 1

    Remove the brackets in the output. The string is perceived as text, respectively, all quotes are escaped.

    var myData1 = <?php echo $json; ?>; //get data