-
提高php程序性能和负载测试
[PHP教程] 2022-02-15 15:50:40 132人阅读
一篇关于提高php程序性能和负载测试的实例代码,有需要的朋友可以看看如何提高自己程序的性能. 计算执行的时间,通过下面这个简单的方法可以计算一段程序的执行时间(微妙),代码如下: $start_time = microtime(true); /...[详细]
-
php实现记住密码自动登录
[PHP教程] 2022-02-15 15:50:21 101人阅读
要实现记住密码自动登录的功能我们大多数据都是利用了客户端的cookies来实现,我们利用php也不例外,有需要的朋友可以参考一下. php制作记住密码自动登录的解决思路,其实也就是对session,cookies的操作,实例代码如下: ...[详细]
-
php中动态调用说明
[PHP教程] 2022-02-15 15:49:57 116人阅读
动态调用在php算是高级的东西了,今天我们来看看这高级的活是什么吧,先来分析一下判断什么是这个动态调用,有需要的朋友看看吧. 在程序中如果加一大堆判断的确是一个很大的麻烦,例如这样: if($fun=a){echo 哎呀!;} el...[详细]
-
PHP利用socket模拟post之fsockopen发送数据
[PHP教程] 2022-02-15 15:49:39 74人阅读
今天有点心烦啊,还是写一篇关于php fsockopen post相关数据的文章吧,我们可以模仿来自然后再发送给对方服务器,有需要的朋友看看吧,代码如下: POST /目的程序 HTTP/1.1 Accept: */* Referer: http://www.Cuoxin.com A...[详细]
-
php实现session多域名多服务器共享session id
[PHP教程] 2022-02-15 15:49:21 182人阅读
我们可以把sessionid保存在数据库中得以实现,这个方法比较安全而且应用广泛,但是不是我们讨论的范围,下面只讲简单的,首先验证的时候产生一个sessionid;代码如下: ?php Session_start(); $sessionId = session_id();/...[详细]
-
php 模拟用户自动在qq空间发表文章
[PHP教程] 2022-02-15 15:48:56 146人阅读
我们这里是一个简单的利用php来php 模拟登录后再到QQ空间发送文章的一个简单的程序,有需要的朋友可以参考,或改进可以给我意见,代码如下: ?php //模拟get post请求函数 /* 函数说明: 功能:请求方式可以get,post,...[详细]
-
php配置memcache缓存方法
[PHP教程] 2022-02-15 15:48:29 116人阅读
1、下载memcache 放到自己的盘符下面 例如:d:memcached 2、开始-cmd-输入命令d:memcachedmemcached.exe -d install 安装 3、安装完成后输入d:memcachedmemcached.exe -d start 4、下载php_memcache.dll,注意自己的...[详细]
-
php解析JSON 数据
[PHP教程] 2022-02-15 15:48:10 90人阅读
大多数流行的 Web 服务如 twitter 通过开放 API 来提供数据一样,它总是能够知道如何解析 API 数据的各种传送格式,包括 JSON,XML 等等,代码如下: $json_string={id:1,name:foo,email:foo@foobar.com,interest:[wordp...[详细]
-
PHP中简单工厂模式实例讲解
[PHP教程] 2022-02-15 15:47:05 166人阅读
PHP中简单工厂模式实例讲解,简单的讲述了一下大家可参考一下. 简单工厂模式: ①抽象基类:类中定义抽象一些方法,用以在子类中实现 ②继承自抽象基类的子类:实现基类中的抽象方法 ③工厂类:用以实例化对象 采用封装方...[详细]
-
windows服务器下实现php定时执行代码方法
[PHP教程] 2022-02-15 15:46:41 107人阅读
一、让PHP定时运行吧. 1、编辑如下代码,并保存为test.php,代码如下: ?php $fp = @fopen(test.txt, a+); fwrite($fp, date(Y-m-d H:i:s) . 让PHP定时运行吧!n); fclose($fp); ? 打开文本输入:D:php4php.exe -q D:php...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]