php基本知识(2)-特殊之处

WBOY
Release: 2016-06-13 10:38:54
Original
843 people have browsed it

php基本知识(二)--特殊之处

1、"+"不是字符串连接符,“12a”+“a”=12 ,字符串连接符为"."2、echo gettype(-3%2); -1 保留符号、integer    echo gettype(-3/2); -1.5 double3、逻辑运算符多了:xor 逻辑异或(逻辑与、逻辑或、逻辑异或、逻辑非)4、调用父类构造函数:parent::__construct()5、变量名可变:$change_name = "huhu";$huhu = "change_name变量被改变了";echo $change_name; //输出:huhu$$change_name = "还原了";echo "<p>";echo $huhu;  //输出:还原了解析:$huhu与$$change_name指向同一块内存6、变量函数function go(){  echo "走了";}$func = "go";func(); 调用了go()函数---可以用来实现回调函数、函数表但是变量函数不能用于语言结构,例如 echo()、print()、unset()、isset()、empty()、include()、require() 以及类似的语句echo $$change_name; //输出:change_name变量被改变了7、break $num; 跳出第几重循环,如while套for套foreach8、switch($var)  $var:任意类型</p>
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!