首页 >后端开发 >php教程 >json_encode传值问题

json_encode传值问题

WBOY
WBOY原创
2016-06-23 14:24:381379浏览

传的内容:
产品描述:

    ·薄型PSP(PSP2000・3000)?用 バッテリ?カバ?です。
    ·薄型PSPでPSP-1000用大型バッテリ?も使用できます!
产品标题:PSP2000・PSP3000用 バッテリ?カバ?(PSP-1000サイズ??版) カラ?:ブラック-543462


 echo json_encode($result);
现在是传过去的是空值,我把这些内容删除就可以传过去了,请问是不是因为有特殊字符的原因??怎么解决??


回复讨论(解决方案)

$tdtxt="<table width='80%' border='0'>  <tr>    <td width='45%' >		<table width='200' border='0'  class='table table-bordered table-striped table-condensed'>	<tr>    <td width='30%'>选择查询的币种:</td>    <td  width='70%'><select name='bizhong' id='bizhong' onchange='huanhuilv(this.value)' style='width:80px' >		<option value='JPY' ".$jpy_sele.">JPY</option>		<option value='EUR' ".$eur_sele.">EUR</option> 		<option value='GBP' ".$gbp_sele.">GBP</option> 				<option value='USD' ".$usd_sele.">USD</option>  		<option value='CAD' ".$cad_sele.">CAD</option>         	  		       </select></td>  </tr>	<tr>    <td width='30%'>查询的币种:</td>    <td  width='70%' id='currency'>".$currency."</td>  </tr>  <tr>    <td width='30%' id='huilvtxt'>CNY->".$currency."汇率:</td>    <td  width='70%' id='huilv' >".$huilv."</td>  </tr>  <tr>    <td width='30%'>ASIN:</td>    <td  width='70%'>".$asin."</td>  </tr>   <tr>    <td width='30%'>重量:</td>    <td  width='70%'>".$weight." g</td>  </tr>    <tr>    <td width='20%'>amazon收费:</td>    <td  width='80%' id='amazon'>".$amazon_charge."</td>  </tr>  </table><table width='200' border='0'  class='table table-bordered table-striped table-condensed'>  <tr>    <td width='30%'  colspan='2'>各物流费用(<span id='huobi'>".$currency."</span>)</td>      </tr>   <tr>    <td width='30%'>深圳邮政:</td>    <td  width='70%' id='szyouzheng'>".$zhongyou_wuliu."</td>  </tr>     <tr>    <td width='20%'>香港邮政:</td>    <td  width='80%' id='hkyouzheng'>".$xianggang_wuliu."</td>  </tr>     <tr>    <td width='20%'>深圳转香港邮政:</td>    <td  width='80%' id='szhkyouzheng'>".$shenzhen_xianggang_wuliu."</td>  </tr>".$jps_txt."      <tr>    <td width='20%'>FBA:</td>    <td  width='80%' id='fba'>".$amazon_charge."</td>  </tr>  </table> <table width='200' border='0'  class='table table-bordered table-striped table-condensed'>  <tr>    <td width='30%'  colspan='2'>采购及其他成本(<span id='huobi1'>".$currency."</span>)</td>      </tr>   <tr>    <td width='30%'>采购成本:</td>    <td  width='70%' id='caigoucost'>".$caigou_cost."</td>  </tr>    <tr>    <td width='20%'>其他成本:</td>    <td  width='80%' id='qitacost'>".$qita_cost."</td>  </tr></table><table width='200' border='0'  class='table table-bordered table-striped table-condensed'>  <tr>    <td width='30%'  colspan='2'>综合成本(<span id='huobi2'>".$currency."</span>)</td>      </tr>   <tr>    <td width='30%'>深圳邮政:</td>    <td  width='70%' id='szcost'>".$shenzhen_cost."</td>  </tr>    <tr>    <td width='20%'>香港邮政:</td>    <td  width='80%' id='hkcost'>".$xianggang_cost."</td>  </tr>     <tr>    <td width='20%'>深圳转香港邮政:</td>    <td  width='80%' id='szhkcost'>".$sz_xg_cost."</td>  </tr>    ".$jps_cost_txt."      <tr>    <td width='20%'>FBA:</td>    <td  width='80%' id='fbacost'>0</td>  </tr>  </table>		</td>	<td width='10%'></td>    <td  width='45%'  valign='top'  align='right'>	<table width='200' border='0'  class='table table-bordered table-striped table-condensed'>  <tr>    <td width='30%'  colspan='2'>建议发货方式为:<strong>".$jianyi_fahuo."</strong></td>      </tr>   <tr>    <td width='28%'  >建议售价(<span id='huobi3'>".$currency."</span>):</td>   <td width='72%' id='shoujia' >".$jizhunjia."</td>  </tr>      </table>  "	.$amazon_td."	</td>  </tr></table>";//$tdtxt = urldecode($tdtxt);$result = array('tdname'=>$amazon_td,				  'tdtxt' =>$tdtxt);			  		 		echo urldecode(json_encode($result));

哪里是空值,你传到哪去了。

json_encode 只能处理 utf-8 编码的数据

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn