This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 今天 | |
$start = strtotime("today"); | |
$end = $start + 3600 * 24; | |
// 本周 | |
$start = mktime(0, 0 , 0, date("m"), date("d") - date("w") + 1, date("Y")); | |
$end = mktime(23, 59, 59, date("m"), date("d") - date("w") + 7, date("Y")); | |
// 本月 | |
$start = mktime(0, 0 , 0, date("m"), 1, date("Y")); | |
$end = mktime(23, 59, 59, date("m"), date("t"), date("Y")); | |
// 今年 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Rsa2 | |
{ | |
private static $PRIVATE_KEY = 'rsa_private_key.pem'; | |
private static $PUBLIC_KEY = 'rsa_public_key.pem'; | |
/** | |
* 获取私钥 | |
* @return bool|resource | |
*/ | |
private static function getPrivateKey() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @param array $data 需要签名的数据 | |
* @param string $key 账户的 KEY | |
* | |
* @return string 签名字符串 | |
*/ | |
function sign($data = array(), $key) | |
{ | |
ksort($data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_weixin() | |
{ | |
var ua = navigator.userAgent.toLowerCase(); | |
if(ua.match(/MicroMessenger/i) == "micromessenger") | |
{ | |
return true; | |
} | |
else | |
{ |