-
PHP实现首页自动选择语言转跳
[PHP教程] 2022-03-01 15:46:56 179人阅读
很多网站在首页上做一些链接,让用户来选择将要访问的各自的语言页面,让中国人选择中文,韩国人选择朝鲜语,等等。那么能不能做程序来自动帮助选择呢? 答案是肯定的,大家都在用google,你用中文系统打开google的...[详细]
-
用PHP通过SMTP发送邮件
[PHP教程] 2022-03-01 15:46:41 109人阅读
由于PHP没有提供现成的smtp函数,却提供了一个功能不甚灵活的mail()函数,这个函数需要服务器配置上的支持,并且不支持smtp验证,在很多场合无法正常的工作,因此不建议使用。本文的目的在于为新手指明方向,并没有...[详细]
-
PHP开发中接收复选框信息的方法
[PHP教程] 2022-03-01 15:46:09 89人阅读
PHP接收多个同名复选框信息不像ASP那样自动转换成为数组,这给使用带来了一定不便。但是还是有解决办法的,就是利用javascript做一下预处理。多个同名复选框在javascript中还是以数组的形式存在的,所以在表单提交之...[详细]
-
通过php来读取xml的数据
[PHP教程] 2022-03-01 15:45:50 181人阅读
今天工作上碰到一个问题 由于我们的项目数据太少 所以需要从web search那边借调数据,他们只给我们提供了一个xml的接口。因此,我们需要把xml的数据转化成html呈现给大家。由于项目是基于php的,所以就摒弃了用js来...[详细]
-
PHP中数组元素升序 降序及重新排序的函数
[PHP教程] 2022-03-01 15:45:19 151人阅读
在PHP数组学习摘录部分了解到最基本的PHP数组的建立和数组元素的显示。需要深入学习下PHP数组的相关操作。首先接触的就是数组元素的升序、降序的排序问题。 1、快速创建数组的函数range() 比如range()函数可以快速创...[详细]
-
PHP实现上传文件生成小图加文字的实例
[PHP教程] 2022-03-01 15:44:54 57人阅读
以下为引用的内容: ? //自动缩图$srcFile原文件,大图;$photo_small目标文件,小图;$dstW,$dstH是小图的宽,高。 function makethumb($srcFile,$photo_small,$dstW,$dstH) { $data = GetImageSize($srcFile); switc...[详细]
-
PHP实现定时生成HTML网站首页
[PHP教程] 2022-03-01 15:44:02 99人阅读
为了提高网站的访问速度,我们往往采用生成静态的方式来实现,这样确实把网站的访问速度提高了很多.但定时生成就受到了一些局限性,大家如果有独立服务器的可以在服务器上设置计划任务,但如果是使用虚拟主机的可就不好...[详细]
-
php对特殊语句查询结果进行数组排序
[PHP教程] 2022-03-01 15:43:41 97人阅读
主要是在开发或学习中的一些经验技巧进行总结,主要就是把解决某种事情更好的方法告诉大家。 1、假如你使用echo输出一个简单的语句,类似与: 以下为引用的内容: ?php echo Hello World!; ? 那么你可以偷懒一下,写...[详细]
-
运用PHP编程防范XSS跨站脚本攻击
[PHP教程] 2022-02-24 14:30:43 101人阅读
国内不少论坛都存在跨站脚本漏洞,国外也很多这样的例子,甚至Google也出现过,不过在12月初时修正了。(编者注:关于跨站脚本漏洞攻击,读者可参阅《详解XSS跨站脚本攻击》)。跨站攻击很容易就可以构造,而且非常隐...[详细]
-
PHP中的clone和new性能对比
[PHP教程] 2022-02-24 14:29:50 150人阅读
clone和new本不应该放在一起比较,它们的作用是不同的。但可能有一些场景下,可以用clone也可以用new,那么这时候我们选哪个呢? 我编写了两个测试,第一个是声明一个空类,第二个是带构造方法、属性的类。另外,我...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]