随笔分类 - PHP
PHP的相关笔记
摘要:<?php /** * 获取ip地址的方法 */ // 1: function getip() { static $ip = ''; $ip = $_SERVER['REMOTE_ADDR']; if(isset($_SERVER['HTTP_CDN_SRC_IP'])) { $ip = $_SER
阅读全文
摘要:php内置函数大全 第2章 Apache函数 15 2.1 Apache信息获取类函数 15 2.1.1 apache_child_terminate函数:在本次请求结束后终止Apache进程 15 2.1.2 apache_get_modules函数:获取Apache的模块列表 16 2.1.3
阅读全文
摘要:HTTP header 详解 Requests部分 Header解释示例 Accept 指定客户端能够接收的内容类型 Accept: text/plain, text/html Accept-Charset 浏览器可以接受的字符编码集。 Accept-Charset: iso-8859-5 Acce
阅读全文
摘要:function getMonDate($start,$end){ $monArr=array(); $dt_start = strtotime($start); $dt_end = strtotime($end); while ($dt_start<=$dt_end){ $monArr[]=date('Y-m-d',$dt_start); ...
阅读全文
摘要:代码的参数为年月日三项,可以更改成一个参数(周日的日期)
阅读全文
摘要:function getWeekDate($year,$weeknum){ $firstdayofyear=mktime(0,0,0,1,2,$year); $firstweekday=date('w',$firstdayofyear); $firstweenum=date('W',$firstdayofyear); if($firstweenum==1){ ...
阅读全文
摘要:常用header汇总: header('Content-Type: text/html; charset=utf-8'); //网页编码 header('Content-Type: text/plain'); //纯文本格式 header('Content-Type: image/jpeg'); /
阅读全文
摘要:什么是calling scope? 在PHP中, 调用一个方法的时候, $this指针指向的对象就是这个方法被调用时刻的calling scope. 对于下面的例子: 在调用bar方法的时候, 处于一个没有calling scope域的上下文中, 所以这个是静态调用. 而对于如下的例子: 在调用ba
阅读全文
摘要:1、class_exists 用于判断一个类是否存在,参数为类名; 2、interface_exists 判断一个接口是否存在,参数为接口名; 3、method_exists 判断一个方法是否存在,参数需要两个,第一个是实例化的对象,第二个是方法名,如果该方是存在的话,那么久会得到一个布尔值的tru
阅读全文
posted @ 2019-05-03 10:03
秋风飒爽
摘要:NULL:当你在你的脚本中写下这样一行代码 $myvariable; //此处你想定义一个变量,但未赋值。会有Notice: Undefined variableecho $myvariable + 3; //使用这个变量出现:Notice: Undefined variable: myvariab
阅读全文
摘要:https://blog.csdn.net/u013472838/article/details/51880470
阅读全文
posted @ 2018-12-29 13:45
秋风飒爽

浙公网安备 33010602011771号