Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use the empty () function in php

Shulou Source: shulou.com Published: 2022-06-01 03:00:58 09月27日 Update

This article mainly shows you "how to use the empty () function in php", which is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn how to use the empty () function in php.

Empty ():

Determine whether the variable is empty

Returns FALSE if var exists and is a non-empty, non-zero value, otherwise returns TRUE.

The following things are considered empty:

"" (empty string)

0 (0 as an integer)

0.0 (as 0 of a floating point number)

"0" (as 0 of the string)

NULL

FALSE

Array () (an empty array)

$var; (a variable that is declared but has no value)

/ / empty (): determine whether the variable is empty $name =''; if (empty ($name)) {echo'is empty; / / empty} else {echo 'not empty';} above is all the content of the article "how to use the empty () function in php". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Functions content variables articles learning help things characters strings arrays integers easy to understand more organization points knowledge empty characters ribbons industries information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MariaDB Shulou Technology Xiaomi NVidia