Home > Article > Backend Development > How to delete variables and detect variables in PHP
This article mainly shares with you the methods of deleting variables and detecting variables in PHP. I hope it can help you.
1. Delete variables:
Syntax:
unset($variable name);
2. Detect variables
Syntax: isset($variable name); detects whether the variable exists, only true and false, the browser displays 0 or 1.
When you want to display true or false, use var_dump(isset($variable name) ) to make a judgment.
var_dump() output content length, type, value, mainly used for program debugging
Related recommendations:
String equality and deletion of variables in php
The above is the detailed content of How to delete variables and detect variables in PHP. For more information, please follow other related articles on the PHP Chinese website!