-
详解PHP死循环写法与作用
[PHP教程] 2022-06-24 12:57:35 63人阅读
很多新手在刚开始写PHP的时候,经常会不小心把循环写成了死循环,但有时候利用好死循环,php的死循环能帮助我们解决很多问题。 最简单的死循环写法 while (true) { // 这里可以写循环中执行操作 } 死循环写法二 do {...[详细]
-
如何运用PHP获取当前页面完整URL地址
[PHP教程] 2022-06-24 12:57:01 200人阅读
PHP获取当前页面完整URL地址 使用PHP编写程序的时候,我们常常想要获取当前页面的URL。 下面提供一个用于获取当前页面URL的函数以及使用方法: 实例一: function get_full_url(){ $protocol = (!emptyempty($_SERVE...[详细]
-
PHP例子计算经纬坐标间的距离
[PHP教程] 2022-06-24 12:56:36 189人阅读
PHP计算两组经纬度坐标之间的距离 定义 define(PI,3.1415926535898); define(EARTH_RADIUS,6378.137); 计算两组经纬度坐标 之间的距离 /** * 计算两组经纬度坐标 之间的距离 * params :lat1 纬度1; lng1 经度1; l...[详细]
-
包含文件include和require在php中的差别含详解
[PHP教程] 2022-06-24 12:56:11 192人阅读
包含文件include和require在php中的区别(含详解) 一 使用语法和简介 1、include()语法: include(/path/to/filename) include()语句将在其被调用的位置处包含一个文件。包含一个文件与在该语句所在位置复制制定文...[详细]
-
PHP递归算法的应用含例子
[PHP教程] 2022-06-24 12:55:40 57人阅读
递归函数为自调用函数,在函数体内直接或直接自个调用自个,但需求设置自调用的条件,若满意条件,则调用函数自身,若不满意则停止本函数的自调用,然后把目前流程的主控权交回给上一层函数来履行,也许这么给我们解...[详细]
-
use关键字在php里的使用含代码
[PHP教程] 2022-06-24 12:55:09 100人阅读
use关键字在php中的使用 1、use最常用在给类取别名,还可以用在闭包函数中,代码如下: ?php function test() { $a = hello; return function ($a)use($a) { echo $a . $a; }; } $b = test(); $b(world);//结果是hel...[详细]
-
php命名格式需注意事项详解
[PHP教程] 2022-06-24 12:54:46 92人阅读
在编写php代码时要时刻保持命名规范,一来容易检查错误,二来方便别人观看。本文详细的介绍了多种命名格式的注意事项。 1.类命名 (1)使用大写字母作为词的分隔,其他的字母均使用小写。 (2)名字的首字母使用大写...[详细]
-
PHP源码加密方法例子详解
[PHP教程] 2022-06-24 12:54:05 183人阅读
PHP源码加密方法实例 下面我们来介绍一下使用PHP加密源码的方法和效果。 ?php function RandAbc($length=){//返回随机字符串 $str=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz; return str_shuffle($str)...[详细]
-
PHP使用JWT组建Token的实例详解
[PHP教程] 2022-06-24 12:53:19 189人阅读
PHP使用JWT创建Token简单示例 依赖 环境:php 5.5 以上 + OpenSSL扩展 lcobucci/JWT 可使用composer 安装 composer require lcobucci/jwt 也可以直接到 GitHub下载 GitHub地址: https://github.com/lcobucci/jwt 参...[详细]
-
php实现简易的登陆功能附源码
[PHP教程] 2022-06-24 12:52:27 166人阅读
在一个网站中登陆功能是必不可少的,本文简单的讲述了在php中如何实现登陆功能。 登录界面: php实现简单的登陆功能(附源码) html代码(login.html): form action=login.php method=post fieldset legend用户登录...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]