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


PHP string::split_word方法代码示例

本文整理汇总了PHP中string::split_word方法的典型用法代码示例。如果您正苦于以下问题:PHP string::split_word方法的具体用法?PHP string::split_word怎么用?PHP string::split_word使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在string的用法示例。


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

示例1: resume

 public function resume()
 {
     $auth = new auth();
     if (!$auth->is_logged_in()) {
         $this->error(L('please_login'), 'auth/index');
     }
     if (!$auth->check_uri_permissions()) {
         $this->error($auth->error);
     }
     $db = M('model_field');
     $filterCond = array();
     //处理选项搜索字段
     $switch_field = $db->field('title,field_name')->where('field_type="switch" and join_index=1 and dmid=6')->findall();
     $model_struct = (include PATH_ROOT . '/caches/model/field/m_resume_basic.php');
     foreach ($switch_field as $value) {
         $filterCond['switchs'][$value['field_name']] = $model_struct[$value['field_name']]['data'];
     }
     //处理选项联动搜索字段
     $linkage_filed = $db->field('title,field_name,lcgid')->where('field_type="linkage" and join_index=1 and dmid=6')->findall();
     foreach ($linkage_filed as $value) {
         $data = $db->table('linkage')->cache(86400)->field('laid,title')->where('lcgid=' . $value['lcgid'])->findall();
         $filterCond['linkages'][$value['field_name']] = array('title' => $value['title'], 'data' => $data);
     }
     //处理选项地区搜索字段
     $filterCond['address'] = $db->table('city')->cache(86400)->field('id,name,direct')->where('pid=0')->findall();
     //地区
     if (isset($_GET['address'])) {
         $filterCond['sonAddress'] = $db->table('city')->cache(86400)->field('id,name')->where('pid=' . $_GET['address'])->findall();
         //地区子类
     }
     $where = array('open' => 1, 'verify' => 1);
     //resume表的条件:公开已验证
     if (isset($_GET['address'])) {
         //地址
         $where[] = 'hope_provice=' . intval($_GET['address']);
     }
     if (isset($_GET['city'])) {
         //地址
         $where[] = 'hope_city=' . intval($_GET['city']);
     }
     if (isset($_GET['work_exp'])) {
         //工作经验
         $where[] = 'work_exp=' . intval($_GET['work_exp']);
     }
     if (isset($_GET['updated'])) {
         //更新时间
         $where['updated'] = 'updated >' . strtotime('-' . $_GET['updated'] . 'days');
     }
     $keywords = array();
     if (!empty($_GET['keywords'])) {
         //关键字
         $_GET['keywords'] = strip_tags($_GET['keywords']);
         $keywords = array_keys(string::split_word($_GET['keywords']));
         $keyword_cond = '';
         foreach ($keywords as $value) {
             $keyword_cond .= 'resume_name LIKE "%' . $value . '%" OR ';
         }
         $keyword_cond = rtrim($keyword_cond, 'OR ');
         $where[] = $keyword_cond;
     }
     $db = V('resume');
     $db->view = array('resume_basic' => array('type' => 'INNER', 'on' => 'resume.resume_id=resume_basic.resume_id'));
     $nums = $db->where($where)->count();
     $page = new page($nums, 10);
     $resumes = $db->where($where)->findall($page->limit());
     if ($resumes) {
         $data_class = new data('resume_basic');
         foreach ($resumes as $key => $value) {
             $resumes[$key] = $data_class->convert($value);
         }
     }
     $this->assign('resumes', $resumes);
     $this->assign('filterCond', $filterCond);
     $this->assign('page', $page->show());
     $this->display('search-resume');
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:76,代码来源:searchControl.php

示例2: addArc

 public function addArc()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         if (empty($_POST['keywords'])) {
             //生成关键字
             $_POST['keywords'] = implode(',', array_keys(string::split_word($_POST['title'])));
         }
         if (empty($_POST['summary'])) {
             //生成描述
             $_POST['summary'] = mb_substr(strip_tags($_POST['contents']), 0, 100, 'utf-8');
         } else {
             $_POST['summary'] = strip_tags($_POST['summary']);
         }
         if (empty($_POST['created'])) {
             //处理创建时间
             $_POST['created'] = time();
         } else {
             $_POST['created'] = strtotime($_POST['created']);
         }
         $_POST['uid'] = $_SESSION['uid'];
         $_POST['updated'] = $_POST['created'];
         $data = array();
         if ($id = $this->arc->addArc($_POST)) {
             // $channel=$this->arc->channel('id='.$_POST['cid'],'setting,pinyin,style,con_tpl');
             // $channel['setting']=json_decode($channel['setting'],true);
             // if($channel['setting']['con_html']){//如果生成文章静态HTML
             // 	$path="/html/{$channel['pinyin']}/".date('Ymd',$_POST['created']);
             // 	$tpl=PATH_ROOT.'/templates/'.$channel['style'].'/content/'.$channel['con_tpl'];//内容页模板
             // 	$this->generate_arc_html($id,$path,$tpl);
             // 	$data['href']=$path."/arc_{$id}.html";
             // }else{
             // 	$data['href']='/content/index/arc/id/'.$id;
             // }
             if ($c_info = $this->_decide_generate_html($_POST['cid'], $id)) {
                 $data['href'] = __ROOT__ . $c_info['path'] . "/arc_{$id}.html";
             } else {
                 $data['href'] = __WEB__ . '/content/index/arc/id/' . $id;
             }
             $this->arc->updateArc('id=' . $id, $data);
             //更新文章的href
             $this->success('添加文章成功!', __CONTROL__ . '/channelArc/cid/' . $_POST['cid']);
         }
     }
     $channels = $this->arc->channels(array(), 'title,id,pid,path');
     $this->assign('channels', $channels);
     $this->display();
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:47,代码来源:contentControl.php

示例3: issueRecruit

 /**
  * 企业发布招聘信息
  */
 function issueRecruit()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $_POST['uid'] = $_SESSION['uid'];
         /* 发布时间 */
         if ($_POST['issue_type'] == '1') {
             $_POST['start_time'] = time();
         } else {
             $_POST['start_time'] = strtotime($_POST['start_time']);
         }
         /* 计算到期时间 */
         $_POST['expiration_time'] = $_POST['start_time'] + $_POST['effective_time'] * 24 * 60 * 60;
         if (C('VERIFY_RECRUIT')) {
             //如果开启了审核职位:0未通过,1通过,2审核中
             $_POST['verify'] = 2;
         } else {
             $_POST['verify'] = 1;
         }
         if (empty($_POST['seo_desc'])) {
             //职位简要
             $_POST['seo_desc'] = mb_substr(strip_tags($_POST['job_desc']), 0, 80, 'UTF-8');
         }
         $field = new field(5);
         $_POST = $field->filterField($_POST);
         $_POST['created'] = time();
         //添加时间
         //处理SEO关键字(截取职位名称)
         $_POST['seo_keywords'] = implode(',', array_keys(string::split_word($_POST['recruit_name'])));
         $_POST['refresh_date'] = $_POST['start_time'];
         $point = abs(getPointRule('issueRecruit'));
         //获得应扣取积分
         $point *= $_POST['effective_time'];
         if ($_SESSION['point'] < $point) {
             $this->error('亲爱的用户,你的积分不够啦。请联系管理员充值');
         }
         $result = $this->recruit->addRecruit($_POST);
         if ($result) {
             deductPoint(-$point);
             //扣取积分
             $con = '发布一个职位信息--<a href="' . __APP__ . '/search/jobs/id/' . $result . '" target="_blank">' . $_POST['recruit_name'] . '</a> 有效期:' . $_POST['effective_time'] . '天,共花费:' . $point . '积分。';
             writeOptLog($con, -$point);
             //写入日志
             $this->success('发布招聘成功', 'index');
         } else {
             $this->error('发布招聘失败');
         }
     }
     $this->display('company/issueRecruit');
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:52,代码来源:companyControl.php


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