Thenbsp\Wechat\Bridge\Util::getTimestamp PHP Method

getTimestamp() public static method

获取当前时间缀
public static getTimestamp ( )
    public static function getTimestamp()
    {
        return (string) time();
    }

Usage Example

Exemplo n.º 1
0
 /**
  * 获取配置
  */
 public function getConfig($asArray = false)
 {
     $options = array('appid' => $this->accessToken->getAppid(), 'url' => Util::getCurrentUrl(), 'timestamp' => Util::getTimestamp(), 'noncestr' => Util::getRandomString(), 'accesstoken' => $this->accessToken['access_token']);
     // 按 ASCII 码排序
     ksort($options);
     $signature = http_build_query($options);
     $signature = urldecode($signature);
     $signature = sha1($signature);
     $config = array('appId' => $options['appid'], 'scope' => 'jsapi_address', 'signType' => 'sha1', 'addrSign' => $signature, 'timeStamp' => $options['timestamp'], 'nonceStr' => $options['noncestr']);
     return $asArray ? $config : Serializer::jsonEncode($config);
 }
All Usage Examples Of Thenbsp\Wechat\Bridge\Util::getTimestamp