Home > Backend Development > PHP Tutorial > PHP's judgment results about empty and isset parameters

PHP's judgment results about empty and isset parameters

WBOY
Release: 2016-07-29 09:12:03
Original
1341 people have browsed it

<?php
	class test{}
	$a1 = null;
	$a2 = "";
	//$a3 = 
	$a4 = 0;
	$a5 = '0';
	$a6 = false;
	$a7 = array();
	//var $a8;
	$a9 = new test();

	for ($i=1; $i <=9 ; $i++) { 
		$s = 'a'.$i;
		echo $i . ":";
		var_dump(isset($$s));
		echo '<br />';

	}
	echo '<br />';
	for ($i=1; $i <=9 ; $i++) { 
		$s = 'a'.$i;
		echo $i . ":";
		var_dump(empty($$s));
		echo '<br />';
	}
Copy after login

PHP 关于empty和isset对于参数的判断结果

That’s basically it

The above introduces the PHP judgment results of empty and isset parameters, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

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