目录
PHP函数
-
highlight_file() 函数:
-
语法:highlight_file(filename,return)
- 作用:将 filename 中的代码按照 php 语法高亮程序中定义的颜色 输出或返回
-
public private protected 变量
- public 表示全局,类内部外部子类都可以访问;
- private表示私有的,只有本类内部可以使用;
- protected表示受保护的,只有本类或子类或父类中可以访问;
-
Is_Valid函数
- 语法:Is_Valid(objectname)
- 参数:objectname:要检查的对象名。
- 作用:检查对象变量是否已经实例化,即实例变量的值是否是个有效的对象。
-
is_numeric()函数
- 语法:bool is_numeric ( mixed $var )
- 参数:$var:要检测的变量。
- 作用:判断是否为数字和数字字符串,如果是返回true,否则返回false。
-
escapeshellarg()函数
- 语法:escapeshellarg ( string
$arg
) - 参数:$arg 需要被转码的参数。
- 作用:将给字符串增加一个单引号并且能引用或者转码任何已经存在的单引号, 这样以确保能够直接将一个字符串传入 shell 函数
-
escapeshellcmd()函数
- 语法:escapeshellcmd ( string
$command
) - 参数:
$command
要转义的命令。 - 作用:对字符串中可能会欺骗 shell 命令执行任意命令的字符进行转义。
-
scandir()函数
- 语法:scandir(directory,sorting_order,context);
- 参数:
- 作用:scandir() 函数返回指定目录中的文件和目录的数组。
-
localeconv()函数
- 语法:localeconv()
- 定义和用法:
-
current()函数
-
语法:current(array)
-
参数:array 必需。规定要使用的数组。
定义和用法:
-
array_reverse() 函数
- 语法:array_reverse(array,preserve)
- 参数:
- 作用:
-
file_get_contents() 函数
- 语法:file_get_contents(path,include_path,context,start,max_length)
- 参数:
- 作用:
-
preg_replace() 函数
- 语法:mixed preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit = -1 [, int &$count ]] )
- 参数:
- 作用:preg_replace 函数执行一个正则表达式的搜索和替换。
-
strpos() 函数
- 语法:strpos(string,find,start)
- 参数:
- 作用:
-
intval() 函数
- 语法:int intval ( mixed $var [, int $base = 10 ] )
- 参数:
- 作用:
-
unserialize() 函数
-
语法:mixed unserialize ( string $str )
-
参数:
-
作用:
-
preg_match() 函数
-
语法:int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags = 0 [, int $offset = 0 ]]] )
-
参数:
-
作用:在 subject 字符串中搜索与 pattern给出的正则表达式相匹配的内容。
-
ctype_alpha()函数
语法:
ctype_alpha ( string$text
) : bool- 参数:text被测试的字符串
- 作用:如果在当前语言环境中
text
里的每个字符都是一个字母,那么就返回true
,反之则返回false
。
-
PHP glob() 函数
语法:
glob(pattern,flags)- 参数:
- 作用:glob() 函数返回匹配指定模式的文件名或目录。
- 用法举例:glob("*") 匹配任意文件,glob("*.txt")匹配以txt为后缀的文件