Home > Backend Development > PHP Tutorial > Integer types and conversions in php

Integer types and conversions in php

WBOY
Release: 2016-07-29 09:13:38
Original
1286 people have browsed it

js data types: string, number, Boolean, array, object, Null, Undefined

php data type

Basic type (scalar type):

Integer: int Integer

Floating point: float double

String: string

Boolean type: bool boolean

Composite type:

Array: array

Object: object

Special type

Empty type: null In this type, there is only one data, then It’s null

Resource type: resource

Integer type:

bin: binary

oct: octal

dec: decimal

hex: hexadecimal

There are only two types of hexadecimal conversion , 10 to others, 10 to others.

10 is converted to other types, which are numeric types and converted to string types.

Others are converted to 10, which is a string type and converted to a numeric type.

When the value (2, 8, 16) is not a string type, it can be compared with the 0 type.

Conversion rules, taking 10 to 2 as an example:

$dec = 10;

$bin = decbin($dec);

The above introduces the integer types and conversions of PHP, including object content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template