我在这个数组上使用json_encode();
,并且<sup id="1">
内的双引号正在打破它......任何人都可以解释为什么?不应该建立这个功能来自动保护这些数据吗?json_encode()抛出无效的json
array(
'Content' => array(
'GUID' => '7dbbfdfd-d1b2-46bd-934f-0730bcf55495',
'Publish_Date' => '2012-04-10 19:28:13',
'Content_Type' => 'Header',
'Content_Body_Type' => 'OVERVIEW',
'Paperless' => 'REQUIRED_EDELIVERY',
'Status' => 'Proof',
'Body' => htmlentities('<h3>This is a subhead</h3>
<p>This is sample content<sup id="1">1 </sup>with variables: <Outside_Sales><Support_Services_Program></p>
<p>Bulleted list:</p>
<ul>
<li>item 1</li>
<li>item 2</li>
<li>item 3</li>
</ul>
<p>more text</p>'),
我以前http://jsonlint.com,以确定问题
如果您转义双引号会发生什么? – 2012-04-25 17:34:00
你可以发布整个阵列吗 – 2012-04-25 17:35:33
你是什么意思与“打破它”?你能发布格式不正确的结果json吗? – Bergi 2012-04-25 17:41:02