search
Homephp教程php手册PHP Cookbook读书笔记 – 第02章数字

第二章主要介绍了PHP如何处理 数字 ,包括了开发中经常使用的小数取舍、 数字 格式化、大 数字 处理,同时还用了不少章节介绍科学计算及高精度计算需要用到的函数 is_numeric() : 判断一个变量或值是否是合法的 数字 类型 abs() : 返回绝对值 round() : 四舍

PHP Cookbook读书笔记 – 第02章数字第二章主要介绍了PHP如何处理数字,包括了开发中经常使用的小数取舍、数字格式化、大数字处理,同时还用了不少章节介绍科学计算及高精度计算需要用到的函数
is_numeric() : 判断一个变量或值是否是合法的数字类型
abs() : 返回绝对值
round() : 四舍五入
ceil() : 取大
floor() : 取小

PHP Cookbook读书笔记 – 第02章数字
range() : 取一个范围内的数,返回一个数组。还可以取范围内的字符数组
mt_rand() : 随机数,可设置取值范围
exp() : 取对数(略过)
pow() :计算指数(略过)
number_format() : 数字格式化,可设置取小数点后的位数,小数点的表示,千分位的表示
setlocale() : 本地化设置,在后面有一个章节会专门介绍
money_format() : 货币格式化,需要本地化设置的支持
sin() : 三角函数之正弦
cos() : 三角函数之反弦
tan() : 三角函数之正切
deg2rad() : 角度转弧度
rad2deg() : 弧度转角度
BCMath() : 高精度计算的函数库
GMP() : 同上
big_int() : PEAR包里的高精度技术库
base_convert() : 2、8、10、16进制转换函数

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool