-
PHP递归函数原理
[PHP教程] 2021-05-25 19:53:38 51人阅读
递归函数最大的好处在于可以精简程序中繁杂重复的程序,并且能以这种特性来执行一些较为复杂的运算动作。例如列表、动态树型菜单以及遍历目录等操作。相应的非递...[详细]
-
归纳PHP字符串拼接
[PHP教程] 2021-05-25 19:53:00 87人阅读
字符串拼接有两种形式,分别是直接使用字符串连接符 . 和赋值运算符 .= 。具体语法格式如下: $string = string1.string2.string3. .stringn; 或者 $string = st...[详细]
-
PHP字符串大小写改变
[PHP教程] 2021-05-25 19:51:52 123人阅读
下面就来分别介绍一下。 1) strtoupper strtoupper() 函数可以将字符串中的字母转化为大写,语法格式如下: strtoupper($string) 其中,$string 为一个字符串类...[详细]
-
为你介绍PHP for循环
[PHP教程] 2021-05-25 10:37:07 83人阅读
【示例】通过 for 循环来计算 100 的阶乘,实现代码如下所示: ?php $sum = 1 ; for ( $i = 1 ; $i = 100 ; $i ++) { $sum *= $i ; } echo 100! = . $sum ; ? 运...[详细]
-
分析PHP foreach循环
[PHP教程] 2021-05-25 10:36:06 183人阅读
PHP foreach 循环结构是遍历数组时常用的方法,foreach 仅能够应用于数组和对象,如果尝试应用于其他数据类型的变量或者未初始化的变量将发出错误信息。 foreach...[详细]
-
php通过各种函数判断0和空
[PHP教程] 2021-05-25 02:05:16 51人阅读
函数对0的判断 对空的判断 补充:下面给大家介绍下php 语法里0不等于null为空的解决办法 今天遇到这样一个问题是这样的: php 语句里,我想判断一个值大于等于0. 我是使用 ( $value !=null $value >=0 ), 返回的结果...[详细]
-
PHP手机短信验证码实现流程详解
[PHP教程] 2021-05-25 02:03:25 183人阅读
本人在自己博客(Laravel)的注册部分 使用手机号注册,需要发送短信验证码。 使用的短信服务提供商,当然具体短信服务提供商大家可以自由选择。 1、实现流程 输入手机号,点击获取验证码 提交正确的短信验证码后,注...[详细]
-
PhpStorm本地断点调试的方法步骤
[PHP教程] 2021-05-25 01:53:33 200人阅读
前言: php代码在调试时,经常是print_r或者var_dump来断点,但是当项目较为复杂的情况下,这么做效率就非常低下了,断点调试就非常好的解决了这个问题。一开始可能不太适应断点调试,但是当习惯之后,越用越舒服。 ...[详细]
-
PHP自动识别当前使用移动终端
[PHP教程] 2021-05-25 01:52:59 84人阅读
虽然现在利用jquery可以准确地判断出当前使用的是那种客户端,但是有时候根据功能和需求,我们可能需要用php来判断当前程序运行的环境,jquery在这里就不说了,这里直接讲讲php是怎么实现的,希望对大家有所帮助。 ...[详细]
-
PHP连接MySQL数据库并以json格式输出
[PHP教程] 2021-05-25 01:51:15 194人阅读
1.简介 PHP连接数据库有多种方法,现介绍常用的MySQL数据库连接方法,PHP连接MySQL也有两种方式,一是面向对象,二是面向过程方式,两种方法稍有区别。下面通过代码介绍两种方法连接MySQL并以json格式输出。 2、面向...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]