当前位置: 首页>>代码示例>>PHP>>正文


PHP str_rp函数代码示例

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


在下文中一共展示了str_rp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     $id = intval($_GET['id']);
     $name = trim($_GET['n']);
     $map['title'] = array('LIKE', '%' . str_rp($name) . '%');
     $map['uid'] = $id;
     $map['status'] = 1;
     if (intval($_GET['cid'])) {
         $map['cate_id'] = intval($_GET['cid']);
     }
     if (trim($_GET['type']) == 'new') {
         $title['name'] = '最新开班';
         $order = 'addtime DESC,sort DESC';
     } else {
         $title['name'] = '课程列表';
         $order = 'sort DESC,read_count DESC';
     }
     $totalRows = $this->mod->where($map)->count();
     $page = new Page($totalRows, 10);
     $list = $this->mod->limit($page->firstRow . ',' . $page->listRows)->where($map)->order($order)->select();
     $this->list = $list;
     $this->assign('page_show', $page->show());
     $this->member_seo_set($id, '课程列表');
     $this->display();
 }
开发者ID:noikiy,项目名称:ypx,代码行数:25,代码来源:CourseController.class.php

示例2: curdLink

 public function curdLink()
 {
     if (IS_AJAX) {
         echo '错误!';
     } elseif (IS_POST) {
         $id = intval($_POST['id']);
         $data['title'] = str_rp(trim($_POST['title']));
         $data['url'] = str_rp(trim($_POST['url']));
         $data['sort'] = intval($_POST['sort']);
         $data['status'] = intval($_POST['status']);
         if ($id) {
             $res = $this->linkMod->where(array('id' => $id))->save($data);
         } else {
             $res = $this->linkMod->add($data);
         }
         if ($res) {
             $this->success('操作成功', U('index'));
         } else {
             $this->error('操作失败');
         }
     } elseif (IS_GET) {
         $id = intval($_GET['id']);
         $info = $this->linkMod->where(array('id' => $id))->find();
         $this->assign('info', $info);
         $this->display();
     }
 }
开发者ID:PrayerEzio,项目名称:zuoxika,代码行数:27,代码来源:LinkController.class.php

示例3: adv_edit

 public function adv_edit()
 {
     if (IS_POST) {
         $ap_id = intval($_POST['ap_id']);
         if ($ap_id) {
             $data = array('title' => str_rp(trim($_POST['ap_name'])), 'url' => str_rp(trim($_POST['ap_link'])), 'intro' => str_rp(trim($_POST['default_content'])), 'type' => intval($_POST['type']), 'addtime' => NOW_TIME, 'ap_width' => intval($_POST['ap_width']), 'ap_height' => intval($_POST['ap_height']), 'sort' => intval($_POST['sort']));
             if (!empty($_FILES['default_pic']['name'])) {
                 $param = array('savePath' => 'member/' . isLogin() . '/', 'subName' => 'Banner', 'files' => $_FILES['default_pic'], 'saveName' => 'gg_' . $ap_id, 'saveExt' => '');
                 $up_return = upload_one($param);
                 if ($up_return == 'error') {
                     $this->error('图片上传失败');
                     exit;
                 } else {
                     $data['img'] = $up_return;
                 }
             }
             $this->model->where(array('id' => $ap_id, 'uid' => isLogin()))->save($data);
             $this->success("操作成功", U('advposition'));
             exit;
         }
     } else {
         $id = intval($_GET['ap_id']);
         $vo = $this->model->where(array('id' => $id, 'uid' => isLogin()))->find();
         $this->assign('vo', $vo);
         $this->display('adv_position_edit');
     }
 }
开发者ID:noikiy,项目名称:ypx,代码行数:27,代码来源:AdvController.class.php

示例4: create

 /**
  * 发起反馈
  */
 public function create()
 {
     if (IS_POST) {
         $data['seller_id'] = $this->mid;
         $data['module'] = MODULE_NAME;
         $data['content'] = str_rp(trim($_POST['content']));
         $data['contact'] = str_rp(trim($_POST['contact']));
         $data['addtime'] = NOW_TIME;
         $data['has_reply'] = 0;
         //图片上传
         if (!empty($_FILES['pic']['size'])) {
             $img = 'feedback_' . re_md5(NOW_TIME . nonce_str());
             $param = array('savePath' => MODULE_NAME . '/feedback/', 'subName' => '', 'files' => $_FILES['pic'], 'saveName' => $img, 'saveExt' => '');
             $up_return = upload_one($param);
             if ($up_return == 'error') {
                 $this->error('图片上传失败');
                 exit;
             } else {
                 $data['pic'] = $up_return;
             }
         }
         $res = $this->model->add($data);
         if ($res) {
             $this->success('谢谢您的意见及建议.', U('detail', array('id' => $res)));
         } else {
             $this->error('非常抱歉,您的意见及建议没有提交成功.');
         }
     } elseif (IS_GET) {
         $this->h3_title = '发起反馈';
         $this->display();
     }
 }
开发者ID:noikiy,项目名称:baomihua,代码行数:35,代码来源:FeedbackController.class.php

示例5: curd

 public function curd()
 {
     if (IS_POST) {
         $id = intval($_POST['exam_id']);
         $data['exam_question'] = str_rp(trim($_POST['exam_question']));
         $data['exam_option_a'] = str_rp(trim($_POST['exam_option_a']));
         $data['exam_option_b'] = str_rp(trim($_POST['exam_option_b']));
         $data['exam_option_c'] = str_rp(trim($_POST['exam_option_c']));
         $data['exam_option_d'] = str_rp(trim($_POST['exam_option_d']));
         $data['exam_answer'] = str_rp(trim($_POST['exam_answer']));
         $data['exam_sort'] = intval($_POST['exam_sort']);
         $data['exam_score'] = intval($_POST['exam_score']);
         if ($id) {
             $res = $this->model->where(array('exam_id' => $id))->save($data);
         } else {
             $res = $this->model->add($data);
         }
         if ($res) {
             $this->success('操作成功', U('index'));
         } else {
             $this->error('操作失败');
         }
     } elseif (IS_GET) {
         $id = intval($_GET['id']);
         if ($id) {
             $this->info = $this->model->where(array('exam_id' => $id))->find();
         }
         $this->display();
     }
 }
开发者ID:PrayerEzio,项目名称:zuoxika,代码行数:30,代码来源:ExamController.class.php

示例6: curdSeo

 public function curdSeo()
 {
     if (IS_POST) {
         $id = intval($_POST['id']);
         $data = array('title' => str_rp(trim($_POST['title'])), 'keywords' => str_rp(trim($_POST['keywords'])), 'description' => str_rp(trim($_POST['description'])), 'cavalue' => str_rp(trim($_POST['cavalue'])), 'remark' => str_rp(trim($_POST['remark'])), 'type' => intval($_POST['type']));
         if ($id) {
             $res = $this->mod->where(array('id' => $id))->save($data);
             if ($res) {
                 $this->success('更新seo成功', U('index'));
             } else {
                 $this->error('更新seo失败');
             }
         } else {
             $id = $this->mod->add($data);
             if ($id) {
                 $this->success('新增seo成功', U('index'));
             } else {
                 $this->error('新增seo失败');
             }
         }
     } elseif (IS_GET) {
         $id = intval($_GET['id']);
         if ($id) {
             $where = array('id' => $id);
             $this->info = $this->mod->where($where)->find();
         }
         $this->display();
     }
 }
开发者ID:PrayerEzio,项目名称:zuoxika,代码行数:29,代码来源:SeoController.class.php

示例7: curd

 public function curd()
 {
     if (IS_POST) {
         $id = intval($_POST['bank_id']);
         $data['bank_name'] = str_rp(trim($_POST['bank_name']));
         $data['bank_tel'] = str_rp(trim($_POST['bank_tel']));
         $data['bank_sort'] = intval($_POST['bank_sort']);
         $data['bank_status'] = intval($_POST['bank_status']);
         if ($id) {
             $res = $this->model->where(array('bank_id' => $id))->save($data);
         } else {
             $res = $this->model->add($data);
         }
         if ($res) {
             $this->success('操作成功', U('index'));
         } else {
             $this->error('操作失败');
         }
     } elseif (IS_GET) {
         $id = intval($_GET['id']);
         if ($id) {
             $this->info = $this->model->where(array('bank_id' => $id))->find();
         }
         $this->display();
     }
 }
开发者ID:PrayerEzio,项目名称:zuoxika,代码行数:26,代码来源:BankController.class.php

示例8: curdStore

 public function curdStore()
 {
     if (IS_POST) {
         $id = intval($_POST['id']);
         $data['store_name'] = str_rp(trim($_POST['store_name']));
         $data['store_keyword'] = str_rp(trim($_POST['store_keyword']));
         $data['province_id'] = intval($_POST['province_id']);
         $data['city_id'] = intval($_POST['city_id']);
         $data['area_id'] = intval($_POST['area_id']);
         $data['store_content'] = str_replace('\'', ''', $_POST['store_content']);
         $data['store_sort'] = intval($_POST['store_sort']);
         $data['store_status'] = intval($_POST['store_status']);
         if ($id) {
             $res = $this->model->where(array('store_id' => $id))->save($data);
         } else {
             $res = $this->model->add($data);
         }
         if ($res) {
             $this->success('操作成功', U('index'));
         } else {
             $this->error('操作失败');
         }
     } elseif (IS_GET) {
         $where['store_id'] = intval($_GET['id']);
         $info = $this->model->where($where)->find();
         $this->assign('info', $info);
         $this->display();
     }
 }
开发者ID:noikiy,项目名称:wakeup,代码行数:29,代码来源:StoreController.class.php

示例9: 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

示例10: curd

 public function curd()
 {
     if (IS_AJAX) {
         echo '错误!';
     } elseif (IS_POST) {
         $id = intval($_POST['article_id']);
         $data['article_title'] = str_rp(trim($_POST['article_title']));
         $data['ac_type'] = str_rp(trim($_POST['ac_type']));
         $data['article_url'] = str_rp(trim($_POST['article_url']));
         $data['seo_title'] = str_rp(trim($_POST['seo_title']));
         $data['seo_key'] = str_rp(trim($_POST['seo_key']));
         $data['seo_desc'] = str_rp(trim($_POST['seo_desc']));
         $data['article_sort'] = intval($_POST['article_sort']);
         $data['article_show'] = intval($_POST['article_show']);
         $data['article_content'] = str_replace('\'', ''', $_POST['article_content']);
         $data['article_time'] = NOW_TIME;
         $data['to_type'] = intval($_POST['to_type']);
         $arc_img = 'sa_' . $data['article_time'];
         //图片上传
         if ($_FILES['article_pic']['size']) {
             if ($id) {
                 //删除图片
                 $article_pic = $this->model->where(array('article_id' => $id))->getField('article_pic');
                 if ($article_pic) {
                     @unlink(BasePath . '/Uploads/' . $article_pic);
                 }
             }
             $param = array('savePath' => 'artic/', 'subName' => '', 'files' => $_FILES['article_pic'], 'saveName' => $arc_img, 'saveExt' => '');
             $up_return = upload_one($param);
             if ($up_return == 'error') {
                 $this->error('图片上传失败');
                 exit;
             } else {
                 $data['article_pic'] = $up_return;
             }
         }
         if ($id) {
             $res = $this->model->where(array('article_id' => $id))->save($data);
         } else {
             $res = $this->model->add($data);
         }
         if ($res) {
             $this->success('操作成功', U('index'));
         } else {
             $this->error('操作失败');
         }
     } elseif (IS_GET) {
         $id = intval($_GET['id']);
         $info = $this->model->where(array('article_id' => $id))->find();
         $this->assign('info', $info);
         $this->display();
     }
 }
开发者ID:noikiy,项目名称:baomihua,代码行数:53,代码来源:SystemArticleController.class.php

示例11: index

 public function index()
 {
     $where = array();
     $order_sn = str_rp(trim($_GET['order_sn']));
     if ($order_sn) {
         $where['order_sn'] = array('like', '%' . $order_sn . '%');
     }
     $count = $this->reportModel->where($where)->count();
     $page = new Page($count, 10);
     $list = $this->reportModel->relation(true)->where($where)->limit($page->firstRow . ',' . $page->listRows)->order('addtime desc')->select();
     $this->assign('list', $list);
     $this->assign('page', $page->show());
     $this->title = '申诉管理';
     $this->assign('search', $_GET);
     $this->display();
 }
开发者ID:noikiy,项目名称:baomihua,代码行数:16,代码来源:ReportController.class.php

示例12: article_class_add

 public function article_class_add()
 {
     if (IS_POST) {
         $data = array();
         $data['dc_upid'] = intval($_POST['ac_parent_id']);
         $data['dc_title'] = str_rp(trim($_POST['dc_title']));
         $data['dc_sort'] = intval($_POST['dc_sort']);
         $return = $this->art_class->add($data);
         if ($return) {
             $this->success("操作成功", U('article_class'));
             exit;
         }
     } else {
         $this->ac_list = $this->art_class->where(array('dc_upid' => 0))->select();
         $this->display('articleclass_add');
     }
 }
开发者ID:noikiy,项目名称:sryy,代码行数:17,代码来源:ArticleController.class.php

示例13: order_op

 public function order_op()
 {
     $order_id = intval($_GET['order_id']);
     if ($order_id) {
         $data = array();
         $data['shipping_name'] = str_rp(trim($_POST['shipping_name']));
         $data['shipping_code'] = str_rp(trim($_POST['shipping_code']));
         $data['shipping_time'] = NOW_TIME;
         $data['order_state'] = 30;
         $vo = $this->model->where('order_id=' . $order_id)->find();
         if ($vo['order_state'] == 20) {
             $this->model->where('order_id=' . $order_id)->save($data);
             $this->success("操作成功", U('order'));
             exit;
         }
     }
 }
开发者ID:noikiy,项目名称:baomihua,代码行数:17,代码来源:OrderController.class.php

示例14: course

 public function course()
 {
     $this->seo_set('培训课程');
     if (!empty($_GET['name'])) {
         $where['title'] = array('LIKE', '%' . str_rp(trim($_GET['name'])) . '%');
     }
     $where['status'] = 1;
     $totalRows = D('CourseView')->where($where)->count();
     $page = new Page($totalRows, 10);
     $page->setConfig('prev', '上一页');
     $page->setConfig('next', '下一页');
     $page->setConfig('first', '首页');
     $page->setConfig('last', '尾页');
     $this->list = D('CourseView')->limit($page->firstRow . ',' . $page->listRows)->where($where)->order('asort DESC,addtime DESC')->select();
     $this->assign('page_show', $page->show());
     $this->cget = $_GET;
     $this->display();
 }
开发者ID:noikiy,项目名称:ypx,代码行数:18,代码来源:AllController.class.php

示例15: index

 /**
  * 基本信息
  */
 public function index()
 {
     if (IS_POST) {
         $data['seller_id'] = $this->mid;
         if (empty($data['seller_id'])) {
             $this->error('请登录.');
         }
         $data['pf_id'] = intval($_POST['pf_id']);
         $data['store_name'] = str_rp(trim($_POST['store_name']));
         $data['wangwang_id'] = str_rp(trim($_POST['wangwang_id']));
         $data['province_id'] = intval($_POST['province_id']);
         $data['city_id'] = intval($_POST['city_id']);
         $data['area_id'] = intval($_POST['area_id']);
         $data['store_url'] = str_rp(trim($_POST['store_url']));
         $data['status'] = 0;
         if (empty($data['pf_id']) || empty($data['store_name']) || empty($data['province_id']) || empty($data['city_id']) || empty($data['area_id']) || empty($data['store_url'])) {
             $this->error('请填写必填信息.');
         } else {
             $res = $this->accountModel->add($data);
             if ($res) {
                 $this->success('绑定账号成功,请等待审核通过.');
             } else {
                 $this->error('绑定账号失败,请联系客服');
             }
         }
     } elseif (IS_GET) {
         $notice = M('SystemArticle')->where(array('article_show' => 1, 'ac_type' => 'Notice'))->order('article_sort desc,article_time desc')->find();
         //         	$aptitude = M('Aptitude')->where(array('apt_status'=>1))->order('apt_sort desc')->select();
         $seller = $this->model->relation(true)->where(array('seller_id' => $this->mid, 'seller_status' => 1))->find();
         if (is_array($seller['Account'])) {
             foreach ($seller['Account'] as $key => $val) {
                 $seller['Account'][$key]['web_platform'] = M('Platform')->where(array('pf_id' => $val['pf_id']))->getField('pf_name');
             }
         }
         $platform = M('Platform')->order('pf_sort desc')->select();
         $province = M('District')->where(array('level' => 1, 'status' => 1))->order('d_sort')->select();
         $this->assign('province', $province);
         $this->assign('platform', $platform);
         $this->assign('seller', $seller);
         $this->assign('notice', $notice);
         $this->h3_title = '基本信息';
         $this->display();
     }
 }
开发者ID:noikiy,项目名称:baomihua,代码行数:47,代码来源:MemberController.class.php


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