当前位置:网站首页>When PHP initiates Alipay payment, the order information is garbled and solved
When PHP initiates Alipay payment, the order information is garbled and solved
2022-08-02 03:52:00 【auspi12341】
$encode = mb_detect_encoding($body, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));$result = $pay->apply(['out_trade_no' => $order_num, // Merchant order number'total_amount' => $money, // payment amount'subject' =>urlencode(mb_convert_encoding($body, 'GB2312', $encode ))// payment order description]);
On the code directly, the order information needs to be converted to GB2312 encoding, and then urlencode encoding