-
解释PHP while和do while循环
[PHP教程] 2021-06-01 12:17:49 65人阅读
1. while 循环 while 循环的作用是反复执行某一项操作,是循环语句中最简单的一个。该语句的特点是:先判断表达式,当表达式结果为真时执行相应的语句。 while...[详细]
-
PHP goto:回到程序的指定位置
[PHP教程] 2021-06-01 12:17:15 125人阅读
我们通常是使用 goto 代替 break 来跳出嵌套的多层循环,goto 本身并没有跳出循环的作用,但其跳转到指定位置的作用使得其可以代替 break 来跳出循环。 和其他语...[详细]
-
PHP return包含函数返回值
[PHP教程] 2021-06-01 12:16:00 129人阅读
PHP 中提供了 return 语句来返回函数的运行结果,其语法格式如下: return 返回值; 其中,返回值为一个可选参数,可以是一个具体的值或者表达式,也可以为空。返...[详细]
-
运用PHP字符串查找
[PHP教程] 2021-06-01 12:15:30 52人阅读
语法如下: int stripos ( string $haystack , string $needle [, int $offset = 0 ] ) 参数说明如下: haystack:在该字符串中查找。 needle:needle 可以是一...[详细]
-
PHP addslashes和stripslashes中的字符串转义与
[PHP教程] 2021-06-01 12:15:04 62人阅读
1、手动转义、还原字符串 字符串可以用单引号 、双引号 、定界符 3 种方式定义,其中最简单的方法就是使用单引号 来定义字符串。当使用字符串时,字符串中很可能...[详细]
-
PHP count与sizeof:得到数组长度
[PHP教程] 2021-05-27 08:14:58 200人阅读
参数说明如下: $array:为待统计的数组或对象; $mode:为可选参数,可以省略。 如果省略 $mode 参数,或者将其设置为 COUNT_NORMAL 或者 0,count() 函数将不...[详细]
-
PHP如何为图像定义颜色
[PHP教程] 2021-05-27 08:12:03 110人阅读
imagecolorallocatealpha() 函数的作用和 imagecolorallocate() 相同,但多了一个额外的设置透明度的参数 alpha,函数的语法格式如下: imagecolorallocatealpha...[详细]
-
详解PHP图片压缩
[PHP教程] 2021-05-27 08:11:33 188人阅读
实际开发中,一般在上传图片时就需要对图片进行压缩操作,想要压缩图片可以使用 imagecopyresized() 或者 imagecopyresampled() 函数,而使用 imagecopyresample...[详细]
-
如何为PHP设置时区
[PHP教程] 2021-05-26 23:39:34 128人阅读
时区的划分 全球分为 24 个时区,每个时区都有自己的本地时间,同一时间内各时区的本地时间相差 1~23 小时,如英国伦敦本地时间与北京本地时间相差 8 个小时。...[详细]
-
PHP new:如何实例化对象
[PHP教程] 2021-05-26 23:38:56 173人阅读
将类实例化成对象非常容易,只需要使用 new 关键字并在后面加上一个和类名同名的方法即可。当然如果在实例化对象时不需要为对象传递参数,在 new 关键字后面直接...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]