Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does the php data type mean?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "what does the php data type mean?". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

In PHP, the data type describes the data unit defined by a set of attributes. The data type of PHP is determined by the context of the program, that is, the specific type is determined by the stored data, which is mainly divided into scalar data type, compound data type and special data type.

Operating environment of this tutorial: windows10 system, PHP7.1 version, DELL G3 computer

What is the meaning of php data type I. introduction of data type

1. PHP is a weakly typed checking language. The data type is determined by the context of the program, that is, the specific type is determined by the stored data.

2. Three types of data types: scalar data type, compound data type and special data type

3. Scalar data types

Boolean Boolean type

Integer integer

Float/double floating point type

String string

4. Compound data types

Array array

Object object

5. Special data types

Resource resources

NULL null

Scalar data types

Boolean (boolean)

1. Save a logical true or false

2. The following circumstances can also be regarded as false:

   Boolean value false, integer value 0, floating point value 0, empty string and string "0"

An array without member variables, an object without units, NULL

Integer (integer)

1. Only integers can be included, and positive and negative numbers can be represented by symbols.

2. Unsigned integers are not supported in PHP

/ / Integer data $a = + 3 * echo b =-5 * * varnished dump ($a); / / the result is int (3) dump "

"; var_dump ($b); / / result is int (- 5) echo"

"; echo $astatabl / result is-2echo"

"

Floating point (float/double)

1. Floating-point type is used to store numbers including decimals, which is an approximate value.

2. Scientific counting method: 10.1e10

/ / floating-point data $a = 1.56 echo echo (a); / / the result is 1.56 echo "

"; var_dump ($b); / / the result is float (1500)

String type (string)

1. Single quotation marks

The variables that appear in    single quotes are output as is, and the PHP engine does not parse them, so single quotation marks are the most efficient way to define strings.

2. Double quotation marks

Variables contained in    double quotation marks are automatically replaced with variable values

3. Delimiter

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report