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

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

WBOY
Release: 2016-06-23 13:53:33
Original
906 people have browsed it

一. 变量的声明

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"; 	}?>
Copy after login





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