首页 > strtotime

PHP设置图片浏览器缓存方法介绍

Cache-Control

Cache-Control 是最重要的规则。这个字段用于指定所有缓存机制在整个请求/响应链中必须服从的指令。这些指令指定用于阻止缓存对请求或响应造成不利干扰的行为。这些指令通常覆盖默认缓存算法。缓存指令是单向的,即请求中存在一个指令并不意味着响应中将存在同一个指令。

阅读全文

php中strtotime()函数的用法

一,获取指定日期的unix时间戳
strtotime("2009-1-22") 示例如下:
1.echo strtotime("2009-1-22")

结果:1232553600
说明:返回2009年1月22日0点0分0秒时间戳
二,获取英文文本日期时间
示例如下:
便于比较,使用date将当时间戳与指定时间戳转换成系统时间
(1)打印明天此时的时间戳strtotime("+1 day")
当前时间:
1.echo date("Y-m-d H:i:s",time())

阅读全文

php中时间日期格式化函数

function format_date( $STRING1 )
{
        $STRING1 = str_replace( "-0", "-", $STRING1 );
        $STR = strtok( $STRING1, "-" );
        $STRING2 = $STR."年";
        $STR = strtok( "-" );
        $STRING2 .= $STR."月";
        $STR = strtok( " " );
        $STRING2 .= $STR."日";
        return $STRING2;
}

阅读全文

PHP货币换算程序代码

一款实用的PHP货币换算程序代码哦,有需要的朋友可以参考一下。

Copy the above code into a new file and save it as CurrencyConverter.php. Whenever you need to make a conversion just include the class file and call the ‘convert’ function. You will need to enter your own mysql database variables such as the login details. The example below will convert £2.50 GBP into US Dollars ($).

阅读全文