當前位置: 首頁>>代碼示例>>PHP>>正文


PHP trimall函數代碼示例

本文整理匯總了PHP中trimall函數的典型用法代碼示例。如果您正苦於以下問題:PHP trimall函數的具體用法?PHP trimall怎麽用?PHP trimall使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了trimall函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: manage

 public function manage()
 {
     if ($this->checkAuthority()) {
         $this->getPublicInfo();
         $page = trimall($this->_get('charge', 'strip_tags', 'category'));
         switch ($page) {
             case 'category':
                 $this->display('manage_category');
                 break;
             case 'message':
                 $this->display('manage_message');
                 break;
             case 'follow':
                 $this->display('manage_follow');
                 break;
             case 'fan':
                 $this->display('manage_fan');
                 break;
             case 'web':
                 $this->display('manage_web');
                 break;
             case 'profile':
                 $this->display('manage_profile');
                 break;
             default:
                 $this->error('出錯了');
         }
     } else {
         $this->error('請先登錄', U('/login'));
     }
 }
開發者ID:usaradman,項目名稱:AlphaBlog,代碼行數:31,代碼來源:UserHomeAction.class.php

示例2: findurl

function findurl($keywords)
{
    $find = '魯大學生網';
    $url_tmpl = "http://www.baidu.com/s?word=%s&pn=%d";
    $result = array();
    foreach ($keywords as $k => $v) {
        $i = 0;
        while ($i <= 1000) {
            $url = sprintf($url_tmpl, urlencode($v), $i);
            $contents = trimall(getpage($url));
            $pattern = '/title":"' . $find . '(.*?)url":"(.*?)"/si';
            preg_match($pattern, $contents, $matches);
            $site_url = isset($matches[2]) ? $matches[2] : null;
            if ($site_url) {
                $ua = getua();
                $page_content = getpage($site_url, array('ua' => $ua));
                $result[] = array('page' => $i / 10 + 1, 'keyword' => $v, 'url' => $site_url);
                break;
            } else {
                $i += 10;
            }
        }
    }
    return $result;
}
開發者ID:ldsn,項目名稱:spider,代碼行數:25,代碼來源:func.php

示例3: userLogin

 /**
  * 用戶token獲取
  **/
 public function userLogin()
 {
     $username = check_empty(trimall(strip_tags($this->input->post('username', TRUE))), FALSE, '1002');
     $password = check_empty(trimall(strip_tags($this->input->post('password', TRUE))), FALSE, '1003');
     //f61e83b9c803be5003ceddacfc6010ba
     $namelen = strlen($username);
     if ($namelen < 4 || $namelen > 16) {
         response_code('1002');
     }
     $passlen = strlen($password);
     if ($passlen != 32) {
         response_code('1003');
     }
     $user = $this->model->get_user_auth_by_name($username);
     if (!$user) {
         response_code('1004');
     }
     //密碼錯誤
     if (md5($password . $user['salt']) != $user['user_pass']) {
         response_code('1004');
     }
     if ($user['role'] == 'innholder') {
         $inn = $this->model->get_user_inn($user['user_id']);
         $user['inn_id'] = $inn['inn_id'];
     }
     $data['token'] = $this->create_token($user);
     response_data($data);
 }
開發者ID:qiuai,項目名稱:qieyou,代碼行數:31,代碼來源:login.php

示例4: clean_array_null

function clean_array_null($v)
{
    $v = trimall($v);
    if (!empty($v)) {
        return true;
    }
    return false;
}
開發者ID:h3len,項目名稱:Project,代碼行數:8,代碼來源:function.php

示例5: register

 /**
  * 注冊
  */
 public function register()
 {
     if (IS_POST) {
         $data = array();
         $smscode = trim($_POST['smscode']);
         if (empty($smscode)) {
             $this->error('驗證碼為空');
         }
         $data['mobile'] = str_rp(trim($_POST['mobile']));
         if ($smscode == session('smscode') && session('codetype') == 'register' && session('mobile') == $data['mobile']) {
             $spread = '';
             $data['pwd'] = re_md5($_POST['pwd']);
             $inviter = str_rp(trimall($_POST['inviter']));
             if ($inviter) {
                 $inviter = explode('_', $inviter);
                 if (is_array($inviter)) {
                     $data['inviter_type'] = intval($inviter[0]);
                     $data['inviter_id'] = intval($inviter[1]);
                     $spread['inviter_id'] = $data['inviter_id'];
                     $spread['inviter_type'] = $data['inviter_type'];
                     $spread['invited_type'] = 1;
                     $spread['spread_stage'] = 0;
                     $spread['spread_time'] = NOW_TIME;
                     $spread['spread_reward'] = 2;
                 }
             }
             $data['register_time'] = NOW_TIME;
             $api = 'http://int.dpool.sina.com.cn/iplookup/iplookup.php';
             $ipparam['format'] = 'js';
             $ipparam['ip'] = get_client_ip();
             $res = get_api($api, $ipparam, 'array');
             if (!empty($res['city'])) {
                 $data['city'] = $res['city'];
             }
             $seller_id = $this->model->add($data);
             if ($seller_id) {
                 unset($data);
                 //推廣賞金
                 if (is_array($spread) && !empty($spread)) {
                     $spread['invited_id'] = $seller_id;
                     M('SpreadLog')->add($spread);
                 }
                 session(null);
                 session('seller_id', $seller_id);
                 $this->success("注冊成功!", U('Member/index'));
                 exit;
             }
         } else {
             $this->error('驗證碼錯誤');
         }
     } elseif (IS_GET) {
         $this->check_login();
         $this->display();
     }
 }
開發者ID:noikiy,項目名稱:baomihua,代碼行數:58,代碼來源:LoginController.class.php

示例6: check_badkey

/**
 * 判斷是否有不合法的詞
 * @param  $string 驗證字符串
 * @return boolean     檢測結果
 * @author 麥當苗兒 <zuojiazi@vip.qq.com>
 */
function check_badkey($string)
{
    //$badkey = "敏感詞|敏感詞B|敏感詞C";
    $badkey = C('BAD_KEY');
    if (preg_match("/{$badkey}/i", trimall($string))) {
        $ret = true;
    } else {
        $ret = false;
    }
    return $ret;
}
開發者ID:rainly123,項目名稱:zyzm,代碼行數:17,代碼來源:function.php

示例7: getNoSetDiyRules

 /**
  * 
  * 獲取允許自定義積分規則 ...
  */
 public function getNoSetDiyRules()
 {
     $creditRules = new creditrules();
     $Members = new members();
     $appid = trimall($this->input['app_uniqueid']);
     if (empty($appid)) {
         $this->errorOutput('請傳應用標識');
     }
     $appDiyRule = $Members->getDiyRulesInfo($appid);
     $diy = $creditRules->getDiyRules('operation,rname,opened');
     foreach ($diy as $k => $v) {
         if (!array_key_exists($k, $appDiyRule)) {
             $this->addItem_withkey($k, $v);
         }
     }
     $this->output();
 }
開發者ID:h3len,項目名稱:Project,代碼行數:21,代碼來源:memberCreditRulesDiy.php

示例8: cancel

 /**
  * 訂單退訂入口
  */
 public function cancel()
 {
     $order_num = input_num($this->input->get('oid'), 10000, FALSE, FALSE, '3001');
     $comment = trimall($this->input->post('comment', TRUE));
     $order = $this->model->get_order_detail_by_order_num($order_num, '', $this->token['inn_id'], FALSE);
     if (!$order || $order['seller_inn'] != $this->token['inn_id']) {
         response_msg('3002');
     }
     if (!in_array($order['state'], array('A', 'P', 'U'))) {
         response_msg('3004');
     }
     $done = array('user_id' => $this->token['user_id'], 'comment' => $comment);
     if ($this->model->order_cancel($order, $done)) {
         response_msg('1');
     }
     response_msg('4000');
 }
開發者ID:qiuai,項目名稱:qieyou,代碼行數:20,代碼來源:order.php

示例9: getAppDiyRulesInfo

 /**
  * 
  * 獲取已經定義的應用積分規則信息 ...
  */
 public function getAppDiyRulesInfo($iSret = false)
 {
     $app_uniqueid = trimall($this->input['app_uniqueid']);
     if (!$app_uniqueid && !$iSret) {
         $this->errorOutput(NO_APPUNIQUEID);
     }
     $AppDiyRulesInfo = $this->Members->getDiyRulesInfo($app_uniqueid);
     if ($iSret) {
         return $AppDiyRulesInfo;
     }
     if (is_array($AppDiyRulesInfo)) {
         foreach ($AppDiyRulesInfo as $k => $v) {
             unset($v['appids'], $v['gids']);
             $this->addItem_withkey($k, $v);
         }
     } else {
         $this->addItem($AppDiyRulesInfo);
     }
     $this->output();
 }
開發者ID:h3len,項目名稱:Project,代碼行數:24,代碼來源:member_credit_rules.php

示例10: create

 /**
  * 發起新的申訴
  */
 public function create()
 {
     if (IS_POST) {
         $data['rp_class_id'] = intval($_POST['rp_class_id']);
         $data['order_sn'] = str_rp(trimall($_POST['order_sn']));
         $data['content'] = str_rp(trim($_POST['content']));
         $data['addtime'] = NOW_TIME;
         $data['seller_id'] = $this->mid;
         $where['order_sn'] = $data['order_sn'];
         $where['seller_id'] = $data['seller_id'];
         $data['member_id'] = M('Order')->where($where)->getField('buyer_id');
         $data['from_to'] = -1;
         $data['handle_status'] = 0;
         if ($data['member_id']) {
             $map['order_sn'] = $data['order_sn'];
             $map['from_to'] = -1;
             $count = $this->model->where($map)->count();
             if ($count) {
                 $this->error('您已經提交過相關申訴,請耐心等待.');
                 die;
             }
             $res = $this->model->add($data);
             if ($res) {
                 $detail['report_id'] = $res;
                 $detail['content'] = '你對買家發起申訴';
                 $detail['addtime'] = NOW_TIME;
                 M('ReportDetail')->add($detail);
                 $this->success('申訴成功.');
             } else {
                 $this->error('抱歉,申訴申請失敗.請聯係客服.');
             }
         } else {
             $this->error('抱歉,沒有相關訂單信息.');
         }
     } elseif (IS_GET) {
         $rp_class = $this->classModel->where(array('rp_class_belong' => 1))->order('rp_class_sort desc')->select();
         $this->assign('rp_class', $rp_class);
         $this->h3_title = '發起新的申訴';
         $this->display();
     }
 }
開發者ID:noikiy,項目名稱:baomihua,代碼行數:44,代碼來源:ReportController.class.php

示例11: rePasswordSendSms

 /**
  * 
  * 重置密碼發送驗證碼接口 ...
  */
 public function rePasswordSendSms()
 {
     $memberId = 0;
     if ($memberName = trimall($this->input['member_name'])) {
         if (hg_check_email_format($memberName)) {
             $this->errorOutput('請填寫正確的用戶名');
         }
         if (hg_verify_mobile($memberName)) {
             $memberId = $this->Members->get_member_id($memberName, false, false, 'shouji');
             if ($memberId) {
                 $isMobile = 1;
                 $platform_id = $memberName;
             }
         }
         if (!$memberId) {
             $memberId = $this->Members->get_member_id($memberName, false, false, 'm2o');
         }
         if (!$memberId) {
             $memberId = $this->Members->get_member_id($memberName, false, false, 'uc');
         }
         if (!$memberId) {
             $this->errorOutput(NO_MEMBER);
         }
         if (!$isMobile) {
             if ($mobile = trimall($this->input['mobile'])) {
                 $checkBind = new check_Bind();
                 $platform_id = $checkBind->check_Bind($memberId, 'shouji');
                 if ($platform_id && $platform_id != $mobile) {
                     $this->errorOutput('對不起,您填寫的手機號不正確,請重新輸入!');
                 } elseif (empty($platform_id)) {
                     $this->errorOutput('對不起,您需找回的帳號未綁定手機號!');
                 }
             } else {
                 $this->errorOutput('請輸入正確的手機號,並獲取驗證碼!');
             }
         }
         $this->send_sms();
     } else {
         $this->errorOutput(NO_MEMBER_NAME);
     }
 }
開發者ID:h3len,項目名稱:Project,代碼行數:45,代碼來源:send_sms.php

示例12: create

 /**
  *新增規則
  * @see adminUpdateBase::create()
  */
 public function create()
 {
     if (!($app_uniqueid = trimall($this->input['app_uniqueid']))) {
         $this->errorOutput('應用標識未傳值');
     }
     if (!($operation = trimall($this->input['operation']))) {
         $this->errorOutput('積分規則操作key未傳值');
     }
     $data = $this->filter_data();
     //獲取提交的數據
     //驗證標識是否重複
     $checkResult = $this->membersql->verify('credit_rules_custom_app', array('appid' => $app_uniqueid, 'operation' => $operation));
     if ($checkResult) {
         $this->errorOutput('此應用積分規則已被自定義');
     }
     if ($data) {
         $creditsRulesDiy = $this->Members->getDiyRulesInfo($app_uniqueid);
         $newDiyRules = array_merge($creditsRulesDiy, array($operation => $data));
         $reDiyApp = $this->Members->credits_rules_diy_app($app_uniqueid, $newDiyRules);
         $this->diyOutPut($reDiyApp);
     }
 }
開發者ID:h3len,項目名稱:Project,代碼行數:26,代碼來源:memberCreditRulesDiyUpdate.php

示例13: keyword_sel

 function keyword_sel($res, $cont)
 {
     $keyword_result = array();
     $ee = 0;
     foreach ($res as $row) {
         $keyword = explode("|", delhtml(trimall($row['con'])));
         $sel_sign = $this->sel_word($keyword, $cont);
         //有匹配數據時
         if ($sel_sign) {
             $keyword_result[$ee]['id'] = $row['id'];
             $keyword_result[$ee]['title'] = $row['title'];
             $keyword_result[$ee]['url'] = $row['url'];
             $keyword_result[$ee]['con'] = $row['con'];
             $keyword_result[$ee]['intr'] = $row['intr'];
             $ee++;
         } else {
             //無匹配數據時下一個數組中對應的關鍵字
             $sel_sign = $this->sel_word($keyword, $cont);
         }
     }
     return $keyword_result;
 }
開發者ID:visonforcoding,項目名稱:cidev,代碼行數:22,代碼來源:home.php

示例14: check_forum_post

 private function check_forum_post($type)
 {
     $forum = array();
     $forum['city'] = check_empty(trimall(strip_tags($this->input->post('city'))), '');
     $forum['lat'] = checkLocationPoint($this->input->post('lat'), 'lat', '');
     //坐標可不傳
     $forum['lon'] = checkLocationPoint($this->input->post('lon'), 'lon', '');
     if (empty($forum['lat']) || empty($forum['lon'])) {
         $forum = array();
     }
     $forum['forum_name'] = check_empty(trimall(strip_tags($this->input->post('title'))), '', '6014');
     $forum['type'] = $type;
     $tags = check_empty(trimall(strip_tags($this->input->post('tags'))), '');
     if ($tags) {
         $detail['tags'] = array();
         $tags = explode(',', $tags);
         foreach ($tags as $key => $row) {
             if (!$row) {
                 continue;
             }
             if (mb_strlen($row) > 6) {
                 response_json('6033', '標簽:"' . $row . '" 字數過長');
             }
             $detail['tags'][] = $row;
         }
         if (count($detail['tags']) > 3) {
             response_code('6032');
         }
         $detail['tags'] = implode(',', $detail['tags']);
     } else {
         $detail['tags'] = '';
     }
     $detail['note'] = check_empty(strip_tags($this->input->post('note')), '');
     $detail['pictures'] = trimall(strip_tags($this->input->post('images', TRUE)));
     if ($type == 'jianren') {
         $detail['line'] = check_empty(trimall(strip_tags($this->input->post('line', TRUE))), FALSE, '6016');
         if (empty($forum['forum_name'])) {
             $forum['forum_name'] = $detail['line'];
         }
         $start_time = check_empty($this->input->post('start_time'), FALSE, '6017');
         if (substr_count($start_time, '-') != 2) {
             response_code('6024');
         }
         list($year, $month, $day) = explode('-', $start_time);
         if (!$year || !$month || !$day || !checkdate($month, $day, $year)) {
             response_code('6024');
         }
         $start_time = strtotime($start_time);
         if (!$start_time || $start_time < TIME_NOW - 86500 || $start_time > TIME_NOW + 31536000) {
             response_code('6024');
         }
         $detail['start_time'] = $start_time;
         $detail['day'] = input_int($this->input->post('day'), 0, 250, FAlSE, '6015');
     } else {
         $detail['pictures'] = check_empty($detail['pictures'], FALSE, '6013');
     }
     if (empty($forum['forum_name'])) {
         response_code('6014');
     }
     return array('forum' => $forum, 'detail' => $detail);
 }
開發者ID:qiuai,項目名稱:qieyou,代碼行數:61,代碼來源:forum.php

示例15: progress

 /**
  * 維修進度
  */
 public function progress()
 {
     $rp_sn = trimall($_GET['sn']);
     $where['rp_sn'] = $rp_sn;
     $where['member_id'] = $this->mid;
     $info = D('Repair')->relation(true)->where($where)->find();
     unset($info['RepairLog']);
     $info['RepairLog'] = M('RepairLog')->where(array('rp_id' => $info['rp_id'], 'is_view' => 1))->order('log_time')->select();
     $this->assign('info', $info);
     $this->display();
 }
開發者ID:PrayerEzio,項目名稱:zuoxika,代碼行數:14,代碼來源:MemberController.class.php


注:本文中的trimall函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。