Php 从卷曲的HTML文件中提取JSON时出现问题

Php 从卷曲的HTML文件中提取JSON时出现问题,php,json,curl,character-encoding,simple-html-dom,Php,Json,Curl,Character Encoding,Simple Html Dom,我不能发布完整的代码示例,因为卷曲需要对我无法访问的系统进行身份验证 卷发很好用。页面以UTF-8编码。我将HTML传递给simple_HTML_dom,并提取存储在HTML元素属性中的JSON 然而,当我尝试对它进行json\u解码时,我被告知有一个语法错误,尽管JSONLint说它是有效的。据我所知,这是某种编码不匹配。JSON看起来确实是ASCII格式的(从简单的html dom出来之后),我尝试了我能找到的一切,从iconv到mb\u convert\u编码utf8\u编码,都没有用 这

我不能发布完整的代码示例,因为卷曲需要对我无法访问的系统进行身份验证

卷发很好用。页面以UTF-8编码。我将HTML传递给simple_HTML_dom,并提取存储在HTML元素属性中的JSON

然而,当我尝试对它进行
json\u解码时,我被告知有一个语法错误,尽管JSONLint说它是有效的。据我所知,这是某种编码不匹配。JSON看起来确实是ASCII格式的(从简单的html dom出来之后),我尝试了我能找到的一切,从
iconv
mb\u convert\u编码
utf8\u编码
,都没有用

这是devtools提供的HAR文件,供任何愿意帮助解决这个问题的人使用

我们试图提取的JSON是:

{"optin":{"icon":"/static/images/autoresponder.check.png","events":[]},"abandon":{"icon":"/static/images/autoresponder.abandon.png","events":{"1182":{"action":"abandon","geo":"NON-EU","list":"START Abandon MACB","mode":"add","provider":"integration.activecampaign","subtype":"tag","trigger_days":"1"},"4257":{"action":"abandon","geo":"NON-EU","list":"25","mode":"add","provider":"integration.activecampaign","subtype":"list","trigger_days":"1"}}},"purchase":{"icon":"/static/images/autoresponder.purchase.png","events":{"3135":{"action":"purchase","geo":"NON-EU","list":"6","mode":"add","provider":"integration.activecampaign","subtype":"list","trigger_days":"1"},"5581":{"action":"purchase","geo":"NON-EU","list":"PURCHASE: MACB","list_freeform":"1","mode":"add","provider":"integration.activecampaign","subtype":"new-tag","trigger_days":"1"},"9922":{"action":"purchase","geo":"NON-EU","list":"25","mode":"add","provider":"integration.activecampaign","subtype":"list","trigger_days":"1"}}},"bump":{"icon":"/static/images/autoresponder.bumppurchase.png","events":{"3883":{"action":"bump","geo":"NON-EU","list":"PURCHASE: Parents Insight PDF","list_freeform":"1","mode":"add","provider":"integration.activecampaign","subtype":"new-tag","trigger_days":"1"}}},"affiliate_signup":{"icon":"/static/images/autoresponder.affiliatesignup.png","events":[]},"refund":{"icon":"/static/images/autoresponder.refund.png","events":[]},"refund_bump":{"icon":"/static/images/autoresponder.refund.png","events":[]},"decline":{"icon":"/static/images/autoresponder.decline.png","events":[]},"refund_recur":{"icon":"/static/images/autoresponder.refund_recur.png","events":[]},"recur_fail":{"icon":"/static/images/autoresponder.recur_fail.png","events":[]},"recur_fail_1":{"icon":"/static/images/autoresponder.recur_fail.png","events":[]},"recur_fail_2":{"icon":"/static/images/autoresponder.recur_fail.png","events":[]},"recur_fail_3":{"icon":"/static/images/autoresponder.recur_fail.png","events":[]},"recur_success":{"icon":"/static/images/autoresponder.recur_success.png","events":[]},"recur_cancel":{"icon":"/static/images/autoresponder.recur_cancel.png","events":[]},"recur_finish":{"icon":"/static/images/autoresponder.recur_success.png","events":[]},"dunning_pre":{"icon":"/static/images/autoresponder.dunning_pre.png","events":[]},"dunning_due":{"icon":"/static/images/autoresponder.dunning_due.png","events":[]},"dunning_post":{"icon":"/static/images/autoresponder.dunning_post.png","events":[]},"expiry_pre":{"icon":"/static/images/autoresponder.dunning_pre.png","events":[]},"expiry_post":{"icon":"/static/images/autoresponder.dunning_post.png","events":[]}}
以下是我尝试过的:

$dom = new simple_html_dom();
$dom->load($html); //cURL result
$ar=$dom->find('.ui-autoresponder-provider');
$act=stripslashes($ar[0]->attr['data-actions']);

$act=iconv(mb_detect_encoding($act, mb_detect_order(), true), "UTF-8", $act); 
$act=iconv(mb_detect_encoding($act), "UTF-8//TRANSLIT//IGNORE",$act);
$act=mb_convert_encoding($act,"UTF-8");
最后3行我已经尝试了单独,并按顺序,以及其他我放弃前来张贴
json_decode
总是导致语法错误

非常感谢您的帮助