-
PHP完成百度 网易 新浪短网址服务的API接口调用
[PHP教程] 2022-01-21 14:07:09 180人阅读
看了几个短网址API服务,于是把它们整理出来,方便以后使用,目前,提供靠谱的短网址API接口的公司不多(谷歌、百度、新浪微博、网易等),而像腾讯微博、淘宝这几个巨头的短网址服务都是仅供内部使用. 1 谷歌、百度、网易...[详细]
-
PHP根据HTTP_USER_AGENT判断客户端访问能否为手
[PHP教程] 2022-01-21 14:06:40 70人阅读
现在web发展速度非常快,各种响应式的站点越来越多,除了APP外,在平时可能需要根据客户终端访问来加载不同时模板或跳转到不同时的域名下,现在分享一个函数,可以做到这样判断.android、ios和wp都已经测试过. PHP实例代...[详细]
-
PHP线上错误日志控制 error_reporting与display
[PHP教程] 2022-01-21 14:06:12 108人阅读
在php学习中error_reporting和display_errors是两个非常重要的参数,我们在学习调试过程中是少不了它们的,开启与关闭这两个错误日志非常的简单只要在php.ini简单处理即可,下文会有介绍. 我们知道产品的生产环境肯定是...[详细]
-
php开发里实用的PHP代码片段
[PHP教程] 2022-01-21 14:05:46 97人阅读
1.关键词高亮,代码如下: function highlight($sString, $aWords) { if (!is_array ($aWords) || emptyempty ($aWords) || !is_string ($sString)) { return false; } $sWords = implode (|, $aWords); return preg_r...[详细]
-
PHP模拟QQ登录,发送与接收信息的例子
[PHP教程] 2022-01-21 14:05:22 56人阅读
下面我们一起来看一个PHP模拟QQ登录,发送和接收信息的例子,希望此例子对各位同学会有所帮助. PHP实例代码如下: ?php header(Content-type: text/html; charset=utf-8); $sid = qqLogin(发送信息的QQ,发送信息的QQ密...[详细]
-
PHP完成数据导入 CSV文件下载的例子
[PHP教程] 2022-01-21 14:05:02 118人阅读
下面我来给各位同学简单的分享两个利用php操作csv格式文件的例子,一个是对csv输出下载,另一个是利用php的fgetcsv函数、fputcsv函数进行读写操作. 导入、导出CSV文件,代码如下: class csv { private $resource; /** *...[详细]
-
PHP利用PHPExcel类导入导出excel
[PHP教程] 2022-01-21 14:04:22 144人阅读
PHPExcel 是用来操作Office Excel 文档的一个PHP类库,它基于微软的OpenXML标准和PHP语言,可以使用它来读...[详细]
-
php多线程thread开发和应用的例子
[PHP教程] 2022-01-21 14:04:00 103人阅读
php多线程的使用,首先需要PHP5.3以上版本,并安装pthreads PHP扩展,可以使PHP真正的支持多线程,扩展如何安装请自行百度. PHP扩展下载:https://github.com/krakjoe/pthreads PHP手册文档:http://php.net/manual/zh/b...[详细]
-
深入理解php中$GLOBALS与global 差别
[PHP教程] 2022-01-21 14:03:15 54人阅读
php中有一个不为很多人所用的超全局变量$GLOBALS,合理使用这个变量能使工作变得更加有效率,本篇文章主要分析一下这个超全局变量的用法以及$GLOBALS和global的区别. $GLOBALS定义:引用全局作用域中可用的全部变量(一...[详细]
-
检测移动装备的php代码,手机访问
[PHP教程] 2022-01-21 14:02:51 159人阅读
如果我们要判断访问网站的是手机用户还是PC用户我们只要获取用户的HTTP_USER_AGENT即可,我先介绍了一个通用的Mobile_Detect,后面两个例子是自己写的希望对各位有帮助. php代码实例如下: //使用实例 include Mobile_D...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]