This JSON data has been subjected to 'JSON.stringify().replace()' ,then i'm trying to json_decode()
in php in the backend. But it wont work.
here is the program:
<?php
$a="{\\\"data\\\":{\\\"lab\\\":[\\\"a\\\",\\\"b\\\",\\\"c\\\",\\\"4\\\",\\\"5\\\",\\\"6\\\",\\\"7\\\",\\\"8\\\",\\\"9\\\",\\\"dd\\\"],\\\"stats\\\":{\\\"t1\\\":{\\\"name\\\":\\\"Tier Creation\\\",\\\"t_name\\\":\\\"dd\\\",\\\"t_desc\\\":\\\"dd\\\"},\\\"t_up\\\":{\\\"d_name\\\":\\\"T Up\\\",\\\"id\\\":4,\\\"up_t\\\":\\\"Li cases\\\",\\\"up_val\\\":[\\\"1\\\",\\\"2\\\",\\\"3\\\",\\\"4\\\",\\\"5\\\",\\\"6\\\",\\\"7\\\",\\\"8\\\",9],\\\"sm_temp\\\":[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"],\\\"ms_end_id\\\":[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"],\\\"short_check\\\":[\\\"0\\\",\\\"0\\\",\\\"0\\\",\\\"0\\\",\\\"0\\\",\\\"0\\\",\\\"0\\\",\\\"0\\\",\\\"0\\\"],\\\"e_sub\\\":[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"test\\\",\\\"\\\",\\\"sda\\\",\\\"\\\"],\\\"e_dy\\\":[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"<p><title><\\/title>\\\\\\\
<center><img src=\\\\\\\\"clouds.jpg\\\\\\\\"\\/><\\/center>\\\\\\\
\\\\\\\
<hr\\/>\\\\\\\
<p><a href=\\\\\\\\"http:\\/\\/somegreatsite.com\\\\\\\\">LinkName<\\/a>isalinktoanotherniftysite<\\/p>\\\\\\\
\\\\\\\
<h1>ThisisaHeader<\\/h1>\\\\\\\
\\\\\\\
<h2>ThisisaMediumHeader<\\/h2>\\\\\\\
\\\\\\\
<p>Sendmemailat<a href=\\\\\\\\"mailto:support@yourcompany.com\\\\\\\\">support@yourcompany.com<\\/a>.<\\/p>\\\\\\\
\\\\\\\
<p>Thisisanewparagraph!<\\/p>\\\\\\\
\\\\\\\
<p><strong>Thisisanewparagraph!<\\/strong><br\\/>\\\\\\\
<strong><em>Thisisanewsentencewithoutaparagraphbreak,inbolditalics.<\\/em><\\/strong><\\/p>\\\\\\\
\\\\\\\
<hr\\/>\\\
\\\",\\\"\\\",\\\"<p>upgraded from {{initialname}} to {{name}} on {{s_date}}\\\
\\\
<p>\\\\\\\\\\\\\\
","\\\
\\\
<p style=\\\"margin-left: 40px;\\\\\\\">{{name}} reached from{{initial_name}}on expiry date {{expiry_date}} name is {{full_name}}, first {{first_name}} and last {{last_name}}\\\
\\\
<p>\\\\\\\\\\\\\\
","\\\
\\\
<p>{{name}} from {{initial_name}} expires on {{expiry_date}} {{full_name}} and first {{first_name}} and last name {{last_name}}\\\
\\\
<p>\\\\\\\\\\\\\\
\\\
\\\
<p>hi hello\\\
\\\",\\\"\\\"],\\\"t_id\\\":[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"],\\\"acc_id\\\":[\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"]},\\\"aton\\\":{\\\"dime\\\":\\\"Po lcon\\\",\\\"grp\\\":{\\\"PRO\\\":{\\\"name\\\":\\\"PRO\\\",\\\"id\\\":2,\\\"a_type\\\":\\\"In terms of gg\\\",\\\"all\\\":[\\\"10.0\\\",\\\"20.0\\\",\\\"20.0\\\",\\\"100\\\",\\\"100\\\",\\\"100\\\",\\\"110\\\",\\\"100\\\",\\\"100\\\",100]},\\\"DEFAULT\\\":{\\\"name\\\":\\\"DEFAULT_ALL\\\",\\\"id\\\":3,\\\"al_type\\\":\\\"rated - In terms of gg\\\",\\\"alloc_val\\\":[\\\"100\\\",\\\"100\\\",\\\"100\\\",\\\"100\\\",\\\"100\\\",\\\"100\\\",\\\"120\\\",\\\"100\\\",\\\"100\\\",100]}}},\\\"finalize\\\":{\\\"lay_nam\\\":\\\"Fin\\\"}},\\\"curr_sym\\\":\\\"\\\"},\\\"ash_age\\\":\\\"\\\",\\\"log\\\":[]}";
$b = array();
$b=json_decode($a,"\0") or die("json decode unsuccessful
");
echo ($b==NULL);
echo print_r($b,true);
?>
output: json decode unsuccessful