You need to use the json_encode constant
JSON_HEX_APOS
as the second parameter which will convert all single quotes
'
to
\u0027
. :
var t = <?php echo json_encode($data, JSON_HEX_APOS);?>;
Then use
encode ()
and
decode ()
javascript functions to convert the text from each array entry back to readable text like this example
by გიორგი უზნაძე
3 years ago
0
Pro tip: use ```triple backticks around text``` to write in code fences