Home >Backend Development >PHP Tutorial >笨鸟学php(二) 如何使用变量

笨鸟学php(二) 如何使用变量

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:53:33928browse

一. 变量的声明

1. php中声明变量的方法:  $var = 123;

2. php是弱类型的语言, 变量的类型由存储的值决定

    注: Java是强类型语言, 声明变量一定要先制定类型

3. isset() 和 unset()

    isset() : 判断值是否存在;    unset() : 去掉变量的值

<?php $a = $b = $c = $d = "hello, world"; 	unset($a); 	if(isset($a)){ 		echo $a; 	}else{ 		echo "not exists"; 	}?>





Statement:
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