Home  >  Article  >  php教程  >  关于php的一些特殊语法,有用函数等

关于php的一些特殊语法,有用函数等

WBOY
WBOYOriginal
2016-06-21 08:49:281318browse

1:单行注释里不要出现   ?> 
2:boolean类型,integer类型,float/double类型,string类型,  array类型,object类型(对象) ,resource类型资源,NULL类型
3:双引号"之间的变量会解析(可以用转义字符  \$    ),单引号的不会解析,原样输出
4:转义字符:\n 换行  \r回车   \t 制表符  \\反斜杠  \$   \'   \"   
5:界定符号 例如 $a = adfsdfsdfsdfsdfsd\$
std;
这个效果和双引号一样。包含的变量也会转换成值。
6:几乎所有的编程语言    ==  表示等于。。。。。记住。
7:is_null($a)  is系列函数(is_bool,is_string,is_int,is_integer,is_float,is_double,is_array,is_object,is_numeric)
8:unset掉变量变成null,不会返回值。
9:数据类型转换    (类型)$var     boolean string,integer,float array object   也可以通过settype函数转换    bool settype($var,$type)
10:define(‘ABC’,123);定义常量  defined('ABC')     用法:ABC ,或者constant('ABC') 或者$a = 'ABC' constant($a)   全用大写
11:$a = &$b;引用赋值
12:函数内部用全局变量用global声明。
13:函数的静态变量用static声明
14:可变变量$$a , $($a)
15:预定义常量:__FILE__,TRUE,FALSE,NULL,
16:预定义变量:$_SERVER
17:按引用传值。
18:函数返回多个值,用数组。。
19:如果某个函数或者操作必须使某个类型,必须先判断类型,再执行代码。foreach函数咯,什么的用is_array判断下。。。
 

本文链接http://www.cxybl.com/html/wlbc/Php/20130616/38660.html



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