php 每天登录获得奖励

WBOY
Release: 2016-06-13 13:09:04
Original
725 people have browsed it

php 每日登录获得奖励。

<?

*获取当前时间的Unix 时间戳

$nowtime = time ();

*最后登录时间 保存格式为Unix 时间戳

$last_login_time;

*当前登录日期
$nowtime = mktime ( 0, 0, 0, date ( 'm', $nowtime ), date ( 'd', $nowtime ), date ( 'Y', $nowtime ) );

*上一次登录日期
$last_login_time = mktime ( 0, 0, 0, date ( 'm', $last_login_time ), date ( 'd', $last_login_time ), date ( 'Y', $last_login_time ) );

*上一次登录日期 + 86400秒/24小时
$last_login_time = $last_login_time+86400;

 
if ($last_login_time== $nowtime) {

*如果相等说明当前登录为第二天第一次登录即获得相应奖励。

*还没测试 具体思路我是这么想的!不知道会不会有BUG。。。
}



?>
Copy after login

?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template