How to use php isset

藏色散人
Release: 2023-03-03 19:46:02
Original
2344 people have browsed it

php isset function is used to detect whether a variable is set. Its syntax is "bool isset (mixed $var [, mixed $...] )". The parameter "var" represents the variable to be checked. If isset is used Testing a variable set to NULL will return FALSE.

How to use php isset

Recommended: "PHP Video Tutorial"

PHP isset() Function

Definition and usage

isset() — Check whether a variable is set.

Syntax

bool isset ( mixed $var [, mixed $... ] )
Copy after login

Check whether the variable is set and not NULL.

If a variable has been released using unset(), it will no longer be isset(). If you use isset() to test a variable that is set to NULL, it will return FALSE. Also note that a NULL byte ("\0") is not equivalent to PHP's NULL constant.

Parameters

var The variable to be checked.

Return value: TRUE if var exists and the value is not NULL, otherwise FALSE.

PHP version: PHP 4, PHP 5, PHP 7

Example

Copy after login

Run result:

This var is set so I will print.bool(true) bool(true) bool(false) bool(false) bool(false)
Copy after login

The above is the detailed content of How to use php isset. For more information, please follow other related articles on the PHP Chinese website!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!