2021-12-07 13:30
138
0
0
0
PHP 正则表达式替换 preg_replace 函数
正则替换
preg_replace() 函数用于正则表达式的搜索和替换。
语法:
mixed preg_replace( mixed pattern, mixed replacement, mixed subject [, int limit ] )
参数说明:
参数说明
pattern
2021-12-07 13:30
82
0
0
0
smarty 中foreach中iteration变量值就是当前循环次数
例子:
{foreach key=key item=item from=$contact name=name}
{$key}: {$item}:{$smarty.foreach.name.iteration}
{/foreach>
注意:得加上:name=name {
2021-12-07 13:30
102
0
0
0
array_diff_key
(PHP 5 >= 5.1.0RC1)
array_diff_key -- 使用键名比较计算数组的差集
说明
array array_diff_key ( array array1, array array2 [, array ...] )
array_diff_key() 返回一个数组,该数组包括了所有出现在 a
2021-12-07 13:29
83
0
0
0
if(!function_exists('_addslashes')){
function _addslashes($str){
if(get_magic_quotes_gpc()){
return $str;
}
else{
return addslashes($str);
}
}
}
addslashes
(
2021-12-07 13:29
94
0
0
0
cal_days_in_month
(PHP 4 >= 4.1.0, PHP 5)
cal_days_in_month -- Return the number of days in a month for a given year and calendar
Description
int cal_days_in_month ( int calend
2021-12-07 13:29
88
0
0
0
set_error_handler
(PHP 4 >= 4.0.1, PHP 5)
set_error_handler -- Sets a user-defined error handler function
例子 1. Error handling with set_error_handler() and trigger_error()
Th
2021-12-07 13:29
94
0
0
0
strpos
(PHP 3, PHP 4, PHP 5)
strpos -- 查找字符串中第一次出现的位置
描述Find position of first occurrence of a string
Description
int strpos ( string haystack, mixed needle [, int offset] )
2021-12-07 13:29
122
0
0
0
sort
(PHP 3, PHP 4, PHP 5)
sort -- 对数组排序
说明
bool sort ( array &array [, int sort_flags] )
本函数对数组进行排序。当本函数结束时数组单元将被从最低到最高重新安排。
注: 本函数为 array 中的单元赋予新的键名。这将删除原有的键名而不仅是重新排序。
如