本文整理汇总了PHP中JSSDK::GetCardApiticket方法的典型用法代码示例。如果您正苦于以下问题:PHP JSSDK::GetCardApiticket方法的具体用法?PHP JSSDK::GetCardApiticket怎么用?PHP JSSDK::GetCardApiticket使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSSDK
的用法示例。
在下文中一共展示了JSSDK::GetCardApiticket方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: JSSDK
<?php
require_once "jssdk.php";
$jssdk = new JSSDK("wx0fed524d0dbafd1e", "b3fca70bef3775f844f3597bb09a2e9d");
$signPackage = $jssdk->GetSignPackage();
$api_ticket = $jssdk->GetCardApiticket();
$timestamp = $signPackage["timestamp"];
$nonce_str = $signPackage["nonceStr"];
$input = array("pzO-Ujm3KC3edMEbR6ziHYd5iRGs", "pzO-Ujt78kJxomc_KgRmbYTuMxLA", "pzO-UjmMjTYkFwOkq3gTMJaOQ0Kc", "pzO-Ujg196H9psKF48t44d3rwM4c", "pzO-Uju1BzG7Xk38egCSH4zi4SXo", "pzO-Ujlc0AOjSGaAX1_4z44d_YCc", "pzO-Ujr6SzYzrYWkBPbriumqJBhY", "pzO-Ujoj4EFjcJNYzGRy6rPqPs80");
$index = rand(0, count($input) - 1);
$card_id = $input[$index];
$array = array("{$api_ticket}", "{$timestamp}", "{$nonce_str}", "{$card_id}");
asort($array);
$new = implode('', $array);
$ticketsignature = sha1($new);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>平潭冠超市摇一摇领代金券活动开始啦</title>
<meta name="viewport"
content="width=device-width, initial-scale=1, user-scalable=0">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="css/style.css">
<link href="images/members_wap.css" rel="stylesheet" type="text/css" />
<link href="images/animate.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/master_csf.css" media="screen"
title="no title" charset="utf-8">