当前位置: 首页 > 2017年3月15日发布的所有文章
  • 提交链接到百度

    /**  *   * @param $urls 链接地址,数组 array('url1','url2')  * @param $siteid 站点id  * @param $action 操作方法,推送数据:urls,更新数据:update,删除数据:del  */ function baidu_linkpost($urls,$siteid = 1,$action = 'urls') {    static $baidu_api;    if(empty($baidu_api) ...

    键盘游走者 发布于 2017-03-15 05:30php抢沙发
  • 判断是否为移动设备

    /**  * 是否为移动设备  * @return bool|int|string  */ function is_mobile_request(){    static $mobile_status;    if (isset($mobile_status)) {       return $mobile_status;    }    $_SERVER['ALL_HTTP'] = isset($_SERVER['ALL_HTTP']) ? $_SERVER['ALL_HTTP'] : '';    $mo ...

    键盘游走者 发布于 2017-03-15 05:29php抢沙发
  • 格式化时间

    /**  * 格式化时间  * @param $timestamp 时间戳  * @param int $type 输出类型,0 Y-m-d H:i:s ;1 Y-m-d H:i ;2 Y-m-d  * @return bool|string  */ function time_format($timestamp, $type = 0){    if ($timestamp == 0) return '';    $types = array('Y-m-d H:i:s', 'Y-m-d H:i', ' ...

    键盘游走者 发布于 2017-03-15 05:28php抢沙发
  • 过滤SQL关键字,mysql入库字段过滤

    /**  * 过滤SQL关键字,mysql入库字段过滤  * @param $val 要过滤的字符串  * @return mixed  */ function sql_replace($val){    $val = str_replace(“\t”, '', $val);    $val = str_replace(“%20”, '', $val);    $val = str_replace(“%27”, '', $val) ...

    键盘游走者 发布于 2017-03-15 05:26php抢沙发
  • 移除xss代码

    /**  * 移除xss代码  * @param $val 要过滤的字符  */ function remove_xss($val){    // remove all non-printable characters. CR(0a) and LF(0b) and TAB(9) are allowed    // this prevents some character re-spacing such as     // note that you have to handle splits with \n, \r, and \t later since they  ...

    键盘游走者 发布于 2017-03-15 05:26php抢沙发