把日期型转成字符型用哪个涵数?谢谢!! $strday = date("Y-m-d",$var_date);或者$strday = date("Y-m-d",strtotime($var_date)); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 日期型不用转就可以变为字符型。像整型,你加上引号就变成字符型了。-----------个性签名----------http://www.esoftnow.com/bbs技术论坛 手册上的,呵,Lucky around U!~strtotime(PHP 3 >= 3.0.12, PHP 4, PHP 5)strtotime -- 将任何英文文本的日期时间描述解析为 Unix 时间戳说明int strtotime ( string time [, int now] )本函数预期接受一个包含美国英语日期格式的字符串并尝试将其解析为 Unix 时间戳(自 January 1 1970 00:00:00 GMT 起的秒数),其值相对于 now 参数给出的时间,如果没有提供此参数则用系统当前时间。 本函数将使用 TZ 环境变量(如果有的话)来计算时间戳。自 PHP 5.1.0 起有更容易的方法来定义时区用于所有的日期/时间函数。此过程在 date_default_timezone_get() 函数页面中有说明。 注: 如果给定的年份是两位数字的格式,则其值 0-69 表示 2000-2069,70-100 表示 1970-2000。 参数time被解析的字符串,格式根据 GNU Date Input Formats 语法 now用来计算返回值的时间戳 返回值成功则返回时间戳,否则返回 FALSE。在 PHP 5.1.0 之前本函数在失败时返回 -1。 更新日志版本 说明 5.1.0 失败时返回 FALSE,不再是 -1。 范例例子 1. strtotime() 例子<?phpecho strtotime("now"), "\n";echo strtotime("10 September 2000"), "\n";echo strtotime("+1 day"), "\n";echo strtotime("+1 week"), "\n";echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n";echo strtotime("next Thursday"), "\n";echo strtotime("last Monday"), "\n";?> 请教php读取word内容到相应的文本框内? 如何把96,00.00分割成9600? mysql_select_db失败 正则问题 山中一菜鸟请教GD的问题 哪位兄弟帮我解释一下这段正则表达式? IIS配置 介绍几本PHP的入门书? 麻烦帮忙看看下面的呆吗?谢谢 关于邮件处理--请教宇凡 导行! 为何php5 无法接受cookie?
像整型,你加上引号就变成字符型了。-----------个性签名----------
http://www.esoftnow.com/bbs
技术论坛
(PHP 3 >= 3.0.12, PHP 4, PHP 5)strtotime -- 将任何英文文本的日期时间描述解析为 Unix 时间戳
说明
int strtotime ( string time [, int now] )
本函数预期接受一个包含美国英语日期格式的字符串并尝试将其解析为 Unix 时间戳(自 January 1 1970 00:00:00 GMT 起的秒数),其值相对于 now 参数给出的时间,如果没有提供此参数则用系统当前时间。 本函数将使用 TZ 环境变量(如果有的话)来计算时间戳。自 PHP 5.1.0 起有更容易的方法来定义时区用于所有的日期/时间函数。此过程在 date_default_timezone_get() 函数页面中有说明。 注: 如果给定的年份是两位数字的格式,则其值 0-69 表示 2000-2069,70-100 表示 1970-2000。 参数
time
被解析的字符串,格式根据 GNU Date Input Formats 语法 now
用来计算返回值的时间戳
返回值
成功则返回时间戳,否则返回 FALSE。在 PHP 5.1.0 之前本函数在失败时返回 -1。 更新日志
版本 说明
5.1.0 失败时返回 FALSE,不再是 -1。 范例
例子 1. strtotime() 例子<?php
echo strtotime("now"), "\n";
echo strtotime("10 September 2000"), "\n";
echo strtotime("+1 day"), "\n";
echo strtotime("+1 week"), "\n";
echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n";
echo strtotime("next Thursday"), "\n";
echo strtotime("last Monday"), "\n";
?>