需要判断两个数组是否有交集,第一个感觉PHP中应该有这个函数,果然:
array array_intersect(array array1,array array2[,arrayN…])
需要判断两个数组是否有交集,第一个感觉PHP中应该有这个函数,果然:
array array_intersect(array array1,array array2[,arrayN…])
date()函数是我们在php开发中常碰到并且会使用到的一个日期函数,下面我来给大家介绍date()函数的一些基本扮靓和方法,有需要了解的朋友可进入参考。
mixed preg_replace ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit = -1 [, int &$count ]] )
pattern
要搜索的模式. 可以使一个字符串或字符串数组.
先来简单了解get_headers()函数
get_headers() 返回一个数组,包含有服务器响应一个 HTTP 请求所发送的标头。
PHP函数split()的基本语法为
array split ( string $pattern, string $string [, int $limit] )。
提示:mb_substr在于php中是默认不被支持的我们需要在在windows目录下找到php.ini打开编辑,搜索mbstring.dll,找到;extension=php_mbstring.dll把前面的;号去掉才可以使用mb_substr函数哦。
发送一个原始 HTTP 标头[Http Header]到客户端。标头 (header) 是服务器以 HTTP 协义传 HTML 资料到浏览器前所送出的字串,在标头与 HTML 文件之间尚需空一行分隔
函数用法
int preg_match_all ( string pattern, string subject, array matches [, int flags] )
htmlentities用法
$str = "John & 'Adams'";
echo htmlentities($str, ENT_COMPAT);
echo "
";
echo htmlentities($str, ENT_QUOTES);
echo "
";
echo htmlentities($str, ENT_NOQUOTES);
?>
iconv不是php的默认函数,也是默认安装的模块。需要安装才能用的。
如果是windows2000+php,你可以修改php.ini文件,将extension=php_iconv.dll前的";"去掉,同时你要copy你的原php安装文件下的iconv.dll到你的winnt/system32下
在magic_quotes_gpc=On的情况下,如果输入的数据有
单引号(’)、双引号(”)、反斜线()与 NUL(NULL 字符)等字符都会被加上反斜线。这些转义是必须的,如果这个选项为off,那么我们就必须调用addslashes这个函数来为字符串增加转义。
定义和用法
explode() 函数把字符串分割为数组。