K,所以我有类似的东西。我试图找出如何不逃避双引号。我认为这是restler正在做的...但我无法在restler代码中找到关于我需要改变的文档或提示。如果我做一个str_replace('“','*',jason_encode ......),它会显示星星......所以它不是json_encode搞砸了......:
....
$thisDeal = new deals_search_element();
$thisDeal->deal_name="name2";
$thisDeal->venue_address="address2";
$thisDeal->latlong=$latlong;
$myDeals[] = $thisDeal;
return json_encode( array( "deals_search"=>$myDeals ));
我的输出是:
"{\"deals_search\":[{\"deal_name\":\"test name 1\",\"deal_venue\":\"\",\"venue_address\":\"test address 1\",\"venue_city\":\"\",\"venue_state\":\"\",\"latlong\":\"1...
我知道数据与代码不匹配...但只要相信我所有这一点,重点是......双引号被转义。我怎么能阻止这个?
答案 0 :(得分:0)
知道了。我试图自己编码自己在restler处理它的地方。关于那部分,我很厚。洛尔
所以行:
return json_encode( array( "deals_search"=>$myDeals ));
......必须成为......
return array( "deals_search"=>$myDeals );