0
在我的數據庫JSON輸出衝突有一些數據是那些來自TinyMCE的編輯器。如果我從一些網站上拷貝一些數據,然後將其粘貼到我的編輯並保存到數據庫,然後它的模樣與HTML編輯器數據PHP
<p style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;"><strong>Knife Rights is pleased to welcome Alan Gottlieb, Founder of the Second Amendment Foundation and Chairman of the Citizens Committee for the Right to Keep and Bear Arms, as the featured speaker at the Knife Rights Sharper Future™ Awards Breakfast at BLADE Show on Saturday, June 7th. Join us for an informative and stimulating start to your Saturday at BLADE Show.</strong></p>
<p style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;"><strong><font color="#CC0000">Seating is Limited!</font></strong> <a style="color: #0000cc; text-decoration: none;" href="http://www.kniferights.org/index.php?option=com_content&task=view&id=106"><strong>Buy your Sharper Future™ Awards Breakfast tickets now!</strong></a> <strong><font color="#CC0000">Tickets will NOT be available at BLADE Show or at the door. Tickets are only available online from Knife Rights.</font></strong> <a style="color: #0000cc; text-decoration: none;" href="http://www.kniferights.org/index.php?option=com_content&task=view&id=106"><strong>Buy your tickets NOW!</strong></a></p>
<p><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;">- See more at: http://www.kniferights.org/#sthash.X2uomQY9.dpuf</span></p>
現在,當我想表明我的JSON輸出數組話,就說明錯誤
Parse error on line 1:
^
Expecting '{', '['
我的代碼是
$output = array(
'status' => $status,
'message' => $message,
'result' => $info
);
echo json_encode($output);
這裏是$ INFO有我的編輯數據的數據。
你爲什麼編碼的HTML大塊的JSON? –
因爲我有需要顯示我的數據的API,這將是JSON格式@Hanky웃Panky – user3533255
它看起來像你有一個錯誤在其他地方......看不出任何問題與此代碼 – konghou