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 null mean in php

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

Share

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

Editor to share with you what null means in php, I believe most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to know it!

Null in php means "empty", a special flag is usually used to indicate that a variable has no value; when a variable is directly assigned to null, when the declared variable has not been assigned, or when the variable is destroyed by the unset () function, the value of a variable is considered to be null.

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

What does null mean in php

One: what does null mean?

In php, NULL is a special tag, a null value indicates that a variable has no value, and the only possible value of the NULL type is NULL.

A variable is considered NULL in the following cases:

1. Is assigned to NULL.

two。 Has not been assigned yet.

3. By unset ().

Second: grammar

The NULL type has only one value, which is the case-insensitive constant NULL.

Is_null (mixed $var): bool

Returns TRUE if var is null, FALSE otherwise.

Check the NULL type to learn when a variable is considered NULL.

Three: switch to NULL

Converting a variable to null using (unset) $var will not delete the variable or its value unset. It just returns the NULL value.

Note: convert empty arrays to null through non-strictly equal'= 'comparisons. If it is possible to get an empty array, use is_null () or'='. $a = array ()

$a = = null

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