1:fnmatch
array fnmatch ( string pattern, string string [, int flags])
fnmatch() 检查传入的 string 是否匹配给出的 shell 统配符 pattern。
此函数对于文件名尤其有用,但也可以用于普通的字符串。普通用户可能习惯于 shell 模式或者至少其中最简单的形式 '?' 和 '*' 通配符,因此使用 fnmatch() 来代替 ereg() 或者 preg_match() 来进行前端搜索表达式输入对于非程序员用户更加方便。
例子 1. 用 shell 中的通配符模式匹配来检查颜色
|
2:strsep
原型:char *strsep(char **stringp, const char *delim);
功能:分解字符串为一组字符串。从stringp指向的位置起向后扫描,遇到delim指向位置的字符后,将此字符替换为NULL,返回stringp指向的地址。
3:strcasecmp
函数说明 strcasecmp()用来比较参数s1和s2字符串,比较时会自动忽略大小写的差异。