-
PHP socket模拟POST请求实例
[PHP教程] 2022-01-19 14:47:42 86人阅读
我们用到最多的模拟POST请求几乎都是使用php curl来实现了,没考虑到PHP socket也可以实现,今天看到朋友写了一文章,下面我来给大家分享一下PHP socket模拟POST请求实例. 以前模拟post请求俺都用PHP curl扩展实现来着,...[详细]
-
关于php 静态变量与静态方法
[PHP教程] 2022-01-19 14:47:23 124人阅读
很多朋友可能分不清楚在php中静态变量与静态方法的用法与区别在哪里,下面我来根据自己的经验来介绍静态变量与静态方法一些理解。 在PHP中,静态变量的解释是存在于类作用域的变量,在第一次初始化时给变量赋值,以后类...[详细]
-
PHP创建桌面快捷方式实例
[PHP教程] 2022-01-19 14:47:07 115人阅读
要利用php创建桌面快捷方式我们需要借助于header,InternetShortcut及一些我看不懂的代码。 方法:新建一个php文件,然后把下面的代码扔进去,保存为比如shortcut.php,放在网站跟目录,代码如下: $shortCut = [InternetSh...[详细]
-
PHP多进程编程实例说明
[PHP教程] 2022-01-19 14:46:45 198人阅读
使用PHP真正的多进程运行模式,适用于数据采集、邮件群发、数据源更新、tcp服务器等环节。 PHP有一组进程控制函数(编译时需要 enable-pcntl与posix扩展),使得php能在*nix系统中实现跟c一样的创建子进程、使用exec函数...[详细]
-
PHP注册码 序列号生成实例程序
[PHP教程] 2022-01-19 14:46:27 173人阅读
昨天开发一个产品要求由网站总后台生成一个注册码/序列号,然后我们以573-225-374-118这种格式生成,并且不重复在数据库是唯一的,下面我把我找到的与自己写的都记录一下。 原理,就是生成mt_rand随机种子来生成,然后利...[详细]
-
PHP异常处理 错误报告 日志
[PHP教程] 2022-01-19 14:46:05 163人阅读
在php中我们会经常碰到一些错误要去处理,下面我来总结php中的异常处理、错误报告、日志一些内容总结与介绍。 错误处理: 1.语法错误 2.运行时错误 3.逻辑错误 错误报告: 错误:E_ERROT 程序会中断,发生错误 警告:...[详细]
-
php中设计模式工厂模式和单例模式实例
[PHP教程] 2022-01-19 14:45:38 169人阅读
1.工厂模式 工厂模式是一种类,它具有为您创建对象的某些方法,您可以使用工厂类创建对象,而不直接使用 new,这样,如果您想要更改所创建的对象类型,只需更改该工厂即可,使用该工厂的所有代码会自动更改。 主要作用是降...[详细]
-
php禁止页面缓存的代码介绍
[PHP教程] 2022-01-19 14:42:48 161人阅读
在php中禁止页面缓存的代码相当简单,只要利用 php header()浏览器发送一个Cache-Control: no-cache或设置页面缓存过期时间为你今天之前就可以了。 有朋友说给出下面这句最简单的禁止页面缓存的方法,代码如下: header...[详细]
-
php ajax完成无刷新获取天气状态
[PHP教程] 2022-01-18 15:51:29 95人阅读
首先我们要明白一点我们自己是无法来做天气预报这种功能的,这里我们只要调用api接口返回的数据就可以了,下面是以中国天气网的api接口调用实例我们一起来学习,天气已经成为生活中不可缺少的话题,与我们的生活有着密切...[详细]
-
php用Curl伪造客户端源IP
[PHP教程] 2022-01-18 15:50:43 52人阅读
在网上找了很多种用Curl伪造客户端源IP的一些方法,几乎都是使用curl函数,后来查证了此函数的使用果然是强大,不但可以伪造客户端源IP还可以伪造代理IP哦,下面我们来看看代码。 一般服务器获取客户IP有三种情况 1.在没...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]