-
学习PHP重定向的三种方法
[PHP教程] 2022-01-15 13:54:57 97人阅读
一、用HTTP头信息 也就是用PHP的HEADER函数。PHP里的HEADER函数的作用就是向浏览器发出由HTTP协议规定的本来应该通过WEB服务器的控制指令,例如:声明返回信息的类型(Context-type: xxx/xxx),页面的属性(No cache, ...[详细]
-
php给上传图片加图片水印
[PHP教程] 2022-01-15 13:54:33 129人阅读
相信大家都知道怎么用PHP为图片增加文字水印,可是如果水印效果为图片呢?该怎么办?别担心,下文就为您分解。我也是近日用到此功能,所以去百度上搜集到了这篇文档,希望对各位有所帮助. form action=?=$_SERVER[PH...[详细]
-
PHP中单引号与双引号用法
[PHP教程] 2022-01-15 13:54:10 69人阅读
双引号里面的字段会经过编译器解释,然后再当作HTML代码输出。 单引号里面的不进行解释,直接输出。 单引号和双引号都有自己的用途。 单引号的内容不会被解析,效率更高。 如下面代码: $url=http://www.mycodes.net;...[详细]
-
PHP获取网页截图
[PHP教程] 2022-01-15 13:53:52 150人阅读
载phantomjs.exe放到网站根目录 下载地址: http://phantomjs.org/download.html php开启exec,给予相应的权限 代码如下: ?php $filename=time(); $a=exec(phantomjs.exe rasterize.js http://www.cmsyuanma.com {$fi...[详细]
-
PHP随机跳转图片完成刷新一次换一张图片
[PHP教程] 2022-01-15 13:53:23 117人阅读
PHP如何实现刷新一次换一张图片,比如广告区域就很适合这样的操作。 代码展示: ?php #随即图片名称 取得值1-20之间的随机数 这个是广告图片 $img = rand(1,20)..jpg; #拼凑,完整的图片地址 $URI = https://www.cmsy...[详细]
-
如何利用php导出excel数据表
[PHP教程] 2022-01-15 13:53:03 94人阅读
利用php导出excel数据表代码 ? Header(Content-type:application/octet-stream); Header(Accept-Ranges:bytes); Header(Content-type:application/vnd.ms-excel); Header(Content-Disposition:attachment;filename=t...[详细]
-
PHP实现抽奖程序中奖概率算法
[PHP教程] 2022-01-15 13:52:29 91人阅读
我们先完成后台PHP的流程,PHP的主要工作是负责配置奖项及对应的中奖概率,当前端页面点击翻动某个方块时会想后台PHP发送ajax请求,那么后台PHP根据配置的概率,通过概率算法给出中奖结果,同时将未中奖的奖项信息一...[详细]
-
PHP获取当前目录和相对目录的方法
[PHP教程] 2022-01-15 13:52:10 195人阅读
?php //获取当前文件所在目录,如果 A.php include B.php 则无论写在哪个文件里,都是表示 A.php 文件所在的目录 echo realpath(.),br; echo getcwd(),br; // 获取当前文件的上级目录,如果 A.php include B.php 则...[详细]
-
PHP汉字加拼音处理类及使用实例
[PHP教程] 2022-01-15 13:51:29 155人阅读
非常好的拼音类 ?php /** * PHP 汉字转拼音 * @author Jerryli(hzjerry@gmail.com) * @version V0.20140715 * @package SPFW.core.lib.final * @global SEA_PHP_FW_VAR_ENV * @example * echo CUtf8_PY::encode(阿里...[详细]
-
PHP技巧提高代码效率
[PHP教程] 2022-01-15 13:50:59 139人阅读
1、用单引号代替双引号来包含字符串,这样做会更快一些。因为PHP会在双引号包围的字符串中搜寻变量, 单引号则不会,注意:只有echo能这么做,它是一种可以把多个字符串当作参数的函数(译注:PHP手册中说echo是语言...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]