摘要: if(!isset($string1)) — 检测变量是否已设置并且非 NULLunset($string3) — 销毁指定的变量。(integer)$num — 四舍五入转化为整数settype($num,'integer') — 使用settype函数转换类型if(is_numeric($boo 阅读全文
posted @ 2018-05-02 17:58 cctv-2014 阅读(671) 评论(0) 推荐(0) 编辑
摘要: <?php // 封装_session_open()函数,连接数据库function _session_open($save_path,$session_name){ global $handle; $handle = mysqli_connect('localhost','root','111') 阅读全文
posted @ 2018-05-02 14:46 cctv-2014 阅读(88) 评论(0) 推荐(0) 编辑
摘要: <?php$path = './tmp/'; // 设置session存储路径session_save_path($path); session_start(); // 初始化session$_SESSION['username'] = true;echo "Session文件名称为:sess_" 阅读全文
posted @ 2018-05-02 14:16 cctv-2014 阅读(100) 评论(0) 推荐(0) 编辑
摘要: <?phpdate_default_timezone_set("Etc/GMT-8");if(!isset($_COOKIE["visittime"])){ //如果Cookie不存在 setcookie("visittime",date("y-m-d H:i:s")); //设置一个Cookie变 阅读全文
posted @ 2018-05-02 11:43 cctv-2014 阅读(117) 评论(0) 推荐(0) 编辑
摘要: <?PHP $time1 = strtotime(date( "Y-m-d H:i:s")); //当前的系统时间 $time2 = strtotime("2018-10-1 00:00:00"); //放假的时间 $time3 = strtotime("2019-1-1"); //2010年元旦 阅读全文
posted @ 2018-05-02 10:56 cctv-2014 阅读(207) 评论(0) 推荐(0) 编辑
摘要: <?php$nextWeek = time() + (7 * 24 * 60 * 60); //7 days; 24 hours; 60 mins; 60secsecho 'Now: '. date('Y-m-d') ."<p>";echo 'Next Week: '. date('Y-m-d', 阅读全文
posted @ 2018-05-02 10:30 cctv-2014 阅读(1011) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-05-02 10:03 cctv-2014 阅读(107) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" cont 阅读全文
posted @ 2018-05-02 09:05 cctv-2014 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2018-05-02 08:56 cctv-2014 阅读(107) 评论(0) 推荐(0) 编辑
摘要: <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>综合运用数组函数,更新数组中的元素值</title><style type="text/css"><!--body { mar 阅读全文
posted @ 2018-05-02 08:42 cctv-2014 阅读(167) 评论(0) 推荐(0) 编辑