3v4l.org

run code in 300+ PHP versions simultaneously
<?php $verificationCode = '6g8998f53f98d69cbdf07c789a7ec1284b9gaeab573a0dc94e76a4db9ceg21a4'; $request = [ "title" => "57c58ce24b1e15e8358b4568", "body" => "57c58ce24b1e15e8358b4568", "charset" => "UTF-8", "isApp" => "app", "defaultbank" => "ICBC", "merchantId" => "100000000002698", "notifyUrl" => "https://requestb.in/12q245v1", "orderNo" => "57c58ce24b1e15e8358b4568", "paymentType" => "1", "paymethod" => "directPay", "returnUrl" => "http://china.isitdomain.com", "service" => "online_pay", "totalFee" => "1.0" ]; // var_dump($request); $request = array_filter($request); // var_dump($request); ksort($request); var_dump($request); // $signParams = []; // foreach ($request as $key => $value) { // $signParams[] = "{$key}={$value}"; // } // $rawSign = implode('&', $signParams) . $verificationCode; $rawSign = http_build_query($request) . $verificationCode; var_dump($rawSign); $sign = strtoupper(sha1($rawSign)); $url = "https://ebank.ztpo.cn/payment/v1/order/100000000002698-57c58ce24b1e15e8358b4567?"; $request['signType'] = 'SHA'; $request['sign'] = $sign; $readyUrl = $url . http_build_query($request); echo $sign, PHP_EOL; echo $readyUrl, PHP_EOL;

preferences:
23.5 ms | 409 KiB | 5 Q