-
PHP分布式框架怎样使用Memcache同步SESSION教程
[PHP教程] 2022-02-24 13:30:24 77人阅读
至于Memcache的安装配置,我们就不讲了,PHP分布式中使用Memcache来同步存储SESSION的步骤如下: 1、直接修改php.ini配置文件 session.save_handler = memcache session.save_path = tcp://127.0.0.100:11211 2、利...[详细]
-
phpexcel导出数据身份证后四位0000处理办法
[PHP教程] 2022-02-24 13:29:49 129人阅读
最近做一个php项目的时候,遇到一个问题。 功能:使用phpexcel导出数据。 问题描述:导出身份证后四位是0000 这是因为在excel中如果在一个默认的格中输入或复制超长数字字符串,它会显示为科学计算法。 方法一:设置...[详细]
-
PHP 单例模式优点意义及如何完成
[PHP教程] 2022-02-24 13:28:48 63人阅读
一、什么是单例模式? 1、含义 作为对象的创建模式,单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统全局地提供这个实例。它不会创建实例副本,而是会向单例类内部存储的实例返回一个引用。 2、单例...[详细]
-
SCWS 中文分词 php安装使用例子
[PHP教程] 2022-02-24 13:28:16 104人阅读
今天发现一个很好用的中文分词工具,分享一下 CWS 是 Simple Chinese Word Segmentation 的首字母缩写(即:简易中文分词系统)。 分词算法上并无太多创新成分,采用的是自己采集的词频词典,并辅以一定的专有名称,...[详细]
-
PHP版微信第三方一键登录及获取用户信息开发方
[PHP教程] 2022-02-24 13:27:29 178人阅读
注意,要使用微信在第三方网页登录是需要服务号才可以哦,所以必须到官方申请。 一开始你需要进入微信公众平台开启开发模式,并且填写oauth2的回调地址,地址填写你项目的域名就可以了.比如:www.baidu.com或zhidao.bai...[详细]
-
php版本银联支付接口开发示例
[PHP教程] 2022-02-24 13:26:49 52人阅读
银联支付,首先要注意二重要的部分: PHP运行环境是5.4.18以上 开了扩展openss 开发手册上面的列子只做参考,因为基本都是错的。你可以试着去官网下一个demo。。。注意现在银联开发,没有测试密钥提供,只能在正式环...[详细]
-
php hex加密解密函数运用例子
[PHP教程] 2022-02-24 13:26:15 72人阅读
加密解密: //Hex(Hex(Md5((原文+密钥).getBytes(utf-8))).getBytes(utf-8)) function String2Hex($string){ $hex=; for ($i=0; $i strlen($string); $i++){ $hex .= dechex(ord($string[$i])); } return $hex; } $ke...[详细]
-
PHP完成MySQL数据库备份的源码
[PHP教程] 2022-02-24 13:25:10 58人阅读
下面是一个php数据库备份的源代码,大家也可以根据自己的需求进行修改。 ?php // 备份数据库 $host = localhost; $user = root; //数据库账号 $password = ; //数据库密码 $dbname = mysql; //数据库名称 // 这里的...[详细]
-
php 替换空行 不匹配空行问题处理办法
[PHP教程] 2022-02-24 13:23:34 129人阅读
一个空行,可能包括,换行符,,空格。对字符串进行处理时,难免会遇到对空行进行处理。 1,替换空行,空行可包括空格,,/t,/f,/n $s = preg_replace(/(^(/s|)*$)/m, ,$s); 2,替换空行,只包括换行符 $s = preg_r...[详细]
-
PHP的imagettftext中文乱码处理方法
[PHP教程] 2022-02-24 13:23:11 119人阅读
分析: 1、确认gb库是否正确安装?没有报这个方法不存在。 2、imagettftext()必须utf-8编码,php的整个项目都是utf-8编码,所以不用太多考虑。如果不是,可以mb_convert_encoding()转换; 3、检查字体是否加载正确,...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]