本文整理汇总了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'));
}
}
示例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;
}
示例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);
}
示例4: clean_array_null
function clean_array_null($v)
{
$v = trimall($v);
if (!empty($v)) {
return true;
}
return false;
}
示例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();
}
}
示例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;
}
示例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();
}
示例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');
}
示例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();
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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();
}