最新 人气 评论

PHP 正则表达式替换 preg_replace 函数

PHP 正则表达式替换 preg_replace 函数 正则替换 preg_replace() 函数用于正则表达式的搜索和替换。 语法: mixed preg_replace( mixed pattern, mixed replacement, mixed subject [, int limit ] ) 参数说明: 参数说明 pattern

smarty 中foreach中iteration变量值就是当前循环次数

smarty 中foreach中iteration变量值就是当前循环次数 例子: {foreach key=key item=item from=$contact name=name} {$key}: {$item}:{$smarty.foreach.name.iteration} {/foreach> 注意:得加上:name=name {

php array_diff_key 使用键名比较计算数组的差集

array_diff_key (PHP 5 >= 5.1.0RC1) array_diff_key -- 使用键名比较计算数组的差集 说明 array array_diff_key ( array array1, array array2 [, array ...] ) array_diff_key() 返回一个数组,该数组包括了所有出现在 a

使用反斜线引用字符串 addslashes

if(!function_exists('_addslashes')){ function _addslashes($str){ if(get_magic_quotes_gpc()){ return $str; } else{ return addslashes($str); } } } addslashes (

php cal_days_in_month

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

set_error_handler 设置一个用户定义的错误处理函数

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

strpos 查找字符串中第一次出现的位置

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] )

sort 对数组排序

sort (PHP 3, PHP 4, PHP 5) sort -- 对数组排序 说明 bool sort ( array &array [, int sort_flags] ) 本函数对数组进行排序。当本函数结束时数组单元将被从最低到最高重新安排。 注: 本函数为 array 中的单元赋予新的键名。这将删除原有的键名而不仅是重新排序。 如
返回顶部 留言