...
|
...
|
@@ -243,10 +243,21 @@ class PayController extends WeChatBaseController |
|
|
public function strtoascii2($str="")
|
|
|
{
|
|
|
$str = mb_convert_encoding($str, 'GB2312');
|
|
|
$change_after = '';
|
|
|
for ($i = 0; $i < strlen($str); $i=$i+2) {
|
|
|
$change_after .= dechex(ord($str[$i])).dechex(ord($str[$i+1]));
|
|
|
// var_dump(strlen($str));
|
|
|
if(strlen($str)%2!=0){
|
|
|
$change_after = '';
|
|
|
for ($i = 0; $i < strlen($str); $i = $i + 1) {
|
|
|
$change_after .= dechex(ord($str[$i]));
|
|
|
// var_dump($change_after);
|
|
|
}
|
|
|
}else {
|
|
|
$change_after = '';
|
|
|
for ($i = 0; $i < strlen($str); $i = $i + 2) {
|
|
|
$change_after .= dechex(ord($str[$i])) . dechex(ord($str[$i + 1]));
|
|
|
// var_dump($change_after);
|
|
|
}
|
|
|
}
|
|
|
// exit();
|
|
|
for ($i=0;strlen($change_after)<130;$i++){
|
|
|
$change_after=$change_after.'00';
|
|
|
}
|
...
|
...
|
|