PHP实现的敏感词过滤方法

PHP实现的敏感词过滤方法

<?php/*PHP实现的敏感词过滤方法*//**@todo 敏感词过滤,返回结果@param array $list 定义敏感词一维数组@param string $string 要过滤的内容@return string $log 处理结果 */function sensitive($list, $string){$count = 0; //违规词的个数 $sensitiveWor...

PHP 2019-12-11 PM 3149次 0条
php根据出生日期计算 年龄/生肖/星座

php根据出生日期计算 年龄/生肖/星座

/**根据出生日期计算 年龄/生肖/星座@param $birth 日期格式的年月日,例:'1999-11-15'@param $symbol 用什么符号分割,例:'-'@return $data 返回数据 */function birthday($birth, $symbol='-'){// 把数组中的值赋给变量 list($birth_year, $birth_month, $birth...

PHP 2019-12-11 PM 2068次 0条
php获取最近七天所有日期

php获取最近七天所有日期

/**获取最近七天所有日期@param string $time@param string $format@return array*/ function get_weeks($time = '', $format='Y-m-d'){ $time = $time != '' ? $time : time(); //组合数据 $date = []; for ($i=1; $i...

PHP 2019-12-11 PM 1937次 0条
PHP常见header状态

PHP常见header状态

<?php//200 正常状态 header('HTTP/1.1 200 OK'); // 301 永久重定向,记得在后面要加重定向地址 Location:$url header('HTTP/1.1 301 Moved Permanently'); // 重定向,其实就是302 暂时重定向 header('Location: http://www.maiyoule....

PHP 2019-12-11 PM 2639次 0条
php下载图片

php下载图片

public function down_images() {//下载图片的链接$url = 'http://qr.liantu.com/api.php?text=https://www.girlsf.com/frontend/public/index.php/subject/personal/index'; $header = array("Connection: Keep...

PHP 2019-12-11 PM 1780次 0条
php友好的时间显示

php友好的时间显示

/**友好的时间显示 *@author yhm *@param int $sTime 待显示的时间@param string $type 类型. normal | mohu | full | ymd | other@param string $alt 已失效 *@return string */function friendly_date($sTime, $type = 'normal', ...

PHP 2019-12-11 PM 2609次 0条
php curl post调用Api获取set-Cookie

php curl post调用Api获取set-Cookie

function post_url($url, $data){$curl = curl_init(); // 启动一个CURL会话 curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); // 对认证证书来源的检查 curl_setopt($curl...

PHP 2019-12-11 PM 4537次 0条
php冒泡排序(数组排序)

php冒泡排序(数组排序)

//冒泡排序(数组排序) function bubble_sort($array) { $count = count($array); if ($count <= 0) return false; for($i=0; $i<$count; $i++){ for($j=$count-1; $j>$i; $j--){ if ($arra...

PHP 2019-12-11 PM 2651次 0条
php将数组按照 id 和 pid 重新组合为树结构

php将数组按照 id 和 pid 重新组合为树结构

/**$list [array] 原始数组$pk [string] id$pid [string] 父级pid$child [array] 承载子集的容器return [array] 返回树结构**/function list_to_trees($list, $pk='id', $pid = 'pid', $child = 'listArea', $root = 0) { //创建Tree...

PHP 2019-12-11 PM 3416次 0条
php curl模拟post提交

php curl模拟post提交

/** * 模拟POST提交 * @param string $url 地址 * @param string $data 提交的数据 * @return string 返回结果 */ function post_url($url, $data) { $curl = curl_init(); // 启动一个CURL会话 curl_setopt($curl, CURLOP...

PHP 2019-12-11 PM 2455次 0条
PHP人民币金额大写转换类

PHP人民币金额大写转换类

class Num2Cny{ static $basical = array(0=>"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"); static $advanced=array(1=>"拾","佰","仟"); public static function ParseNumber($number){$number=trim($number...

PHP 2019-12-11 PM 2034次 0条