• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP trimall函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中trimall函数的典型用法代码示例。如果您正苦于以下问题:PHP trimall函数的具体用法?PHP trimall怎么用?PHP trimall使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了trimall函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 麦当苗儿 <[email protected]>
 */
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


示例16: reSetPasswordUser

 /**
  *
  * 找回密码验证方法(支持验证输入的手机号是否已经绑定) ...
  */
 public function reSetPasswordUser()
 {
     $type = isset($this->input['type']) ? intval($this->input['type']) : -1;
     //找回类型
     $identifierUserSystem = new identifierUserSystem();
     $identifier = $identifierUserSystem->setIdentifier((int) $this->input['identifier'])->checkIdentifier();
     //多用户系统
     $memberId = 0;
     $isEmail = 0;
     $isMobile = 0;
     if ($memberName = trimall($this->input['member_name'])) {
         if (hg_check_email_format($memberName)) {
             $memberId = $this->Members->get_member_id($memberName, false, false, 'email', $identifier);
             if ($memberId) {
                 $isEmail = 1;
                 $platform_id = $memberName;
             }
         } elseif (hg_verify_mobile($memberName)) {
             $memberId = $this->Members->get_member_id($memberName, false, false, 'shouji', $identifier);
             if ($memberId) {
                 $isMobile = 1;
                 $platform_id = $memberName;
             }
         }
         if (!$memberId) {
             $memberId = $this->Members->get_member_id($memberName, false, false, 'm2o', $identifier);
         }
         if (!$memberId) {
             $memberId = $this->Members->get_member_id($memberName, false, false, 'uc', $identifier);
         }
         if (!$memberId) {
             $this->errorOutput(NO_MEMBER);
         }
         if ($type == 1) {
             if (!$isEmail) {
                 if ($email = trimall($this->input['email'])) {
                     $checkBind = new check_Bind();
                     $platform_id = $checkBind->check_Bind($memberId, 'email');
                     if ($platform_id && $platform_id != $email) {
                         $this->errorOutput(EMAIL_BIND_ACCOUNT_ERROR);
                     } else {
                         if (!$platform_id) {
                             $this->errorOutput(EMAIL_NO_BIND_ACCOUNT);
                         }
                     }
                 } else {
                     $this->errorOutput(EMAIL_INPUT_BIND_ACCOUNT);
                 }
             }
         } elseif ($type == 0) {
             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(MOBILE_BIND_ACCOUNT_ERROR);
                     } elseif (empty($platform_id)) {
                         $this->errorOutput(MOBILE_NO_BIND_ACCOUNT);
                     }
                 } else {
                     $this->errorOutput(MOBILE_INPUT_BIND_ACCOUNT);
                 }
             }
         } else {
             $this->errorOutput(REPASSWORD_TYPE_ERROR);
         }
         $this->input['member_name'] = $platform_id;
         $this->reset_password();
     } else {
         $this->errorOutput(NO_MEMBER_NAME);
     }
 }
开发者ID:h3len,项目名称:Project,代码行数:76,代码来源:member_update.php


示例17: check_inn_info

 private function check_inn_info()
 {
     $innInfo = array();
     $innInfo['inn_name'] = check_empty(trimall(strip_tags($this->input->post('inn_name', TRUE))), FALSE, '1010');
     $innInfo['dest_id'] = input_int($this->input->post('dest_id'), 1, FALSE, FALSE, '1011');
     $innInfo['local_id'] = input_int($this->input->post('local_id'), 1, FALSE, FALSE, '1012');
     $profit = check_empty($this->input->post('profit'), FALSE, '1013');
     $innInfo['profit'] = sprintf("%.2f", $profit);
     if ($innInfo['profit'] < 0 || $innInfo['profit'] > 100) {
         response_code('1013');
     }
     $innInfo['inner_contacts'] = check_empty(trimall(strip_tags($this->input->post('inner_contacts'))), FALSE, '1014');
     $innInfo['inner_moblie_number'] = input_mobilenum($this->input->post('inner_moblie_number'), '1015');
     //默认为用户账号(手机号)
     $bdlon = number_format(check_empty($this->input->post('bdlon'), FALSE, '1016'), 7, '.', "");
     $bdlat = number_format(check_empty($this->input->post('bdlat'), FALSE, '1016'), 7, '.', "");
     $gps = BD09LLtoWGS84($bdlon, $bdlat);
     $innInfo['lon'] = $gps[0];
     $innInfo['lat'] = $gps[1];
     $innInfo['bdgps'] = $bdlon . ',' . $bdlat;
     /*	$innInfo['bank_info'] = check_empty(trimall(strip_tags($this->input->post('bank_info'))),FALSE,'1017');
     		$innInfo['bank_account_no'] = input_num(trimall($this->input->post('bank_account_no')),FALSE,FALSE,FALSE,'1018');
     		$innInfo['bank_account_no'] = check_luhn($innInfo['bank_account_no'],'1018');
     		$innInfo['bank_account_name'] = check_empty(trimall(strip_tags($this->input->post('bank_account_name'))),FALSE,'1019');
     	*/
     $innInfo['bank_info'] = $this->input->post('bank_info', TRUE);
     $innInfo['bank_account_no'] = $this->input->post('bank_account_no', TRUE);
     $innInfo['bank_account_name'] = $this->input->post('bank_account_name', TRUE);
     $innInfo['inner_telephone'] = check_empty(trimall(strip_tags($this->input->post('inner_telephone'))), '');
     $innInfo['inn_address'] = check_empty(trimall(strip_tags($this->input->post('inn_address'))), FALSE, '1020');
     return $innInfo;
 }
开发者ID:qiuai,项目名称:qieyou,代码行数:32,代码来源:inns.php


示例18: credits_rules_diy_app

 /**
  * 积分规则自定义函数(应用自定义规则),如果某个应用的某个定义规则需要删除,则不传即可。否则不需要删除的,都需要重新传一次
  */
 public function credits_rules_diy_app($appid, $rules_diy)
 {
     /**
      *
      *配置属性:字段类型(支持检测类型):type 目前仅支持整形和字符型;支持属性:min 最小(值或者字符串个数)限制,max最大(值或者字符串个数)限制,legal允许填的合法值(例如某个字段只限制0或者1,就设置array(0,1))...
      *备注:每项参数进行参数检测之前都要进行根据type内容进行强制类型转换
      * @var array()
      */
     $configDiyField = array('rname' => array('type' => 'string', 'min' => '1', 'max' => '10'), 'opened' => array('type' => 'int', 'legal' => array(0)), 'cyclelevel' => array('type' => 'int', 'min' => '0', 'max' => '4'), 'cycletype' => array('type' => 'int', 'min' => '0', 'max' => '4'), 'cycletime' => array('type' => 'int', 'min' => '0'), 'rewardnum' => array('type' => 'int', 'min' => '0'), 'credit1' => array('type' => 'int'), 'credit2' => array('type' => 'int'));
     $appid = trimall($appid);
     if (empty($appid)) {
         return array('status' => 0);
     }
     $op = array();
     if ($rules_diy && is_array($rules_diy)) {
         $op = array_keys($rules_diy);
         //取更新的积分规则key
         $rules = $this->getcreditrule($op, true);
         //获取积分规则
         /**处理提交的数据开始**/
         foreach ($rules_diy as $k => $v) {
             if (is_array($v) && $rules[$k]['iscustom']) {
                 foreach ($v as $kk => $vv) {
                     if (array_key_exists($kk, $configDiyField) && isset($rules[$k][$kk])) {
                         if ($configDiyField[$kk]['type'] == 'string') {
                             $rules_diy[$k][$kk] = $vv = (string) $vv;
                         } elseif ($configDiyField[$kk]['type'] == 'int') {
                             $rules_diy[$k][$kk] = $vv = (int) $vv;
                         }
                         if (is_string($vv)) {
                             $strlen = mb_strlen($vv, 'UTF8');
                             if (isset($configDiyField[$kk]['min']) && !($strlen >= $configDiyField[$kk][min])) {
                                 return array('status' => -1);
                                 //值小于最小限制
                             }
                             if (isset($configDiyField[$kk]['max']) && !($strlen <= $configDiyField[$kk][max])) {
                                 return array('status' => -2);
                                 //值大于最大限制
                             }
                             if (isset($configDiyField[$kk]['legal']) && !in_array($vv, $configDiyField[$kk]['legal'])) {
                                 return array('status' => -3);
                                 //值不合法,不在可设置范围
                             }
                         }
                         if (is_int($vv)) {
                             if (isset($configDiyField[$kk]['min']) && !($vv >= $configDiyField[$kk][min])) {
                                 return array('status' => -1);
                                 //值小于最小限制
                             }
                             if (isset($configDiyField[$kk]['max']) && !($vv <= $configDiyField[$kk][max])) {
                                 return array('status' => -2);
                                 //值大于最大限制
                             }
                             if (isset($configDiyField[$kk]['legal']) && !in_array($vv, $configDiyField[$kk]['legal'])) {
                                 return array('status' => -3);
                                 //值不合法,不在可设置范围
                             }
                         }
                     } else {
                         unset($rules_diy[$k][$kk]);
                         //unset掉不允许定义的字段,防止非法数据
                     }
                 }
             } else {
                 unset($rules_diy[$k]);
                 //unset掉不允许定义的规则,防止非法数据
             }
         }
         /**处理提交的数据结束**/
     }
     $old_rules = array();
     $insert = array();
     $sql = "SELECT appids,operation FROM " . DB_PREFIX . "credit_rules WHERE appids <>''";
     $query = $this->db->query($sql);
     while ($row = $this->db->fetch_array($query)) {
         if ($row['appids'] && is_string($row['appids'])) {
             $appids = explode(',', $row['appids']);
         } else {
             $appids = array();
         }
         $old_rules[$row['operation']] = $appids;
     }
     foreach ($old_rules as $key => $val) {
         if (in_array($key, $op)) {
             if (!in_array($appid, $val)) {
                 $insert[$key] = $val;
                 $insert[$key][] = $appid;
             } else {
                 $insert[$key] = $val;
             }
         } elseif (!in_array($key, $op)) {
             if (in_array($appid, $val)) {
                 $insert[$key] = $val;
                 $arr_key = array_search($appid, $insert[$key]);
                 array_splice($insert[$key], $arr_key, 1);
             } elseif (!in_array($gid, $val)) {
                 $insert[$key] = $val;
//.........这里部分代码省略.........
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:members.core.php


示例19: isset

include_once '../functions/functions.php';
//some function *** required
// online players
$onlinecallback = isset($_GET['onlinecallback']) ? trim($_GET['onlinecallback']) : '';
// *** required for jsonp and json
$path = "E:/Steam/SteamApps/common/Unturned/";
// where is your game root do not delete the last "/" use "/" instead of "\"
$file = $path . "Unturned_Data/Managed/mods/OnlinePlayers/OnlinePlayers.txt";
// do not change this
if (empty($_GET['port'])) {
    $data = array('status' => 'error arg p or port can not empty');
    $data = json_encode($data);
} else {
    $port = $_GET['port'];
    exec("netstat -aon|findstr" . " " . $port, $port_return);
    if (!empty($port_return)) {
        $exp = explode("*:*", $port_return[0]);
        $data['status']['pid'] = trimall($exp[1]);
        $data['status']['server_status'] = 'running';
        if (alexReadFile($file)) {
            $fileArr = explode("\r\n", trim(alexReadFile($file)));
            $data = end($fileArr);
        }
    } else {
        $data['status']['pid'] = "NULL";
        $data['status']['server_status'] = "stopped";
        $data = json_encode($data);
    }
}
echo $onlinecallback . $data;
// this line required ****
开发者ID:liasica,项目名称:unturnedapi,代码行数:31,代码来源:index.php


示例20: addDomain

 function addDomain()
 {
     $data = array('cid' => p('uid'), 'uid' => uid(), 'bidlimit' => p('bidlimit'), 'reserveprice' => p('reserveprice'), 'credit' => DOMAIN_SELL_CREDIT_LOCK, 'domainname' => trimall(p('domainname')), 'register' => htmlspecialchars(p('register')), 'expiration' => strtotime(p('expiration')), 'tradeway' => implode(',', p('tradeway')), 'deadline' => strtotime(p('deadline')), 'totalbonus' => p('totalbonus'), 'percentbonus' => p('percentbonus'), 'description' => htmlspecialchars(p('description')), 'checked' => 1, 'pubdate' => time());
     $this->db->insert($this->table, $data);
     return $this->db->insert_id();
 }
开发者ID:hetykai,项目名称:domain_auction,代码行数:6,代码来源:domain_model.php



注:本文中的trimall函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP trimlink函数代码示例发布时间:2022-05-23
下一篇:
PHP trim_the_string函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap