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

PHP utf8_to_gbk函数代码示例

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

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



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

示例1: convert

 /**
  * Convert encoding
  *
  * @param $value
  * @param $to
  * @param $from
  *
  * @return string
  */
 public static function convert($value, $to, $from)
 {
     if ($value == null) {
         return $value;
     }
     //有ccode库
     $isccode = function_exists('is_gbk');
     //专门有处理gbk/utf8转码的扩展,解决一些badcase
     if ($to === 'GBK' && ($from === 'UTF-8' || $from === 'UTF8') && $isccode) {
         $v = utf8_to_gbk($value, strlen($value), UCONV_INVCHAR_REPLACE);
         if ($v !== false) {
             return $v;
         } else {
             Logger::warn("utf8_to_gbk fail str=%s", bin2hex($value));
         }
     }
     if (($to === 'UTF-8' || $to === 'UTF8') && $from === 'GBK' && $isccode) {
         $v = gbk_to_utf8($value, strlen($value), UCONV_INVCHAR_REPLACE);
         if ($v !== false) {
             return $v;
         } else {
             Logger::warn("gbk_to_utf8 fail str=%s", bin2hex($value));
         }
     }
     //return mb_convert_encoding($value,$to,$from);
     //mb_convert会由于字符编码问题出fatal,改成iconv //ignore模式
     return iconv($from, $to . '//ignore', $value);
 }
开发者ID:huimang,项目名称:wisphp,代码行数:37,代码来源:Encoding.php


示例2: convertfile

 function convertfile($in_charset, $out_charset, $str)
 {
     if (function_exists('mb_convert_encoding')) {
         if (empty($in_charset)) {
             $encode_arr = array('UTF-8', 'ASCII', 'GBK', 'GB2312', 'BIG5', 'JIS', 'eucjp-win', 'sjis-win', 'EUC-JP');
             $encoded = mb_detect_encoding($str, $encode_arr);
             if (!empty($encoded)) {
                 $in_charset = $encoded;
             }
         }
         echo $in_charset;
         return mb_convert_encoding($str, $out_charset, $in_charset);
     } else {
         require_once PATH . 'include/charset.func.php';
         $in_charset = strtoupper($in_charset);
         $out_charset = strtoupper($out_charset);
         if ($in_charset == 'UTF-8' && ($out_charset == 'GBK' || $out_charset == 'GB2312')) {
             return utf8_to_gbk($str);
         }
         if (($in_charset == 'GBK' || $in_charset == 'GB2312') && $out_charset == 'UTF-8') {
             return gbk_to_utf8($str);
         }
         return $str;
     }
 }
开发者ID:tanny2015,项目名称:DataStructure,代码行数:25,代码来源:spider_class.php


示例3: table

 } else {
     $usinfo = $db->getone("select * from " . table('members') . " where username = '{$username}' LIMIT 1");
 }
 if (!empty($usinfo)) {
     $db->query("update " . table('members') . " set `weixin_openid`=null,`weixin_nick`='',bindingtime=0 where weixin_openid='" . $fromUsername . "'");
     $success = false;
     $pwd_hash = $usinfo['pwd_hash'];
     $usname = $usinfo['username'];
     $pwd = md5(md5($password) . $pwd_hash . $QS_pwdhash);
     if ($usinfo['password'] == $pwd) {
         $access_token = get_access_token();
         $w_url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=" . $access_token . "&openid=" . $fromUsername . "&lang=zh_CN";
         $w_result = https_request($w_url);
         $w_userinfo = json_decode($w_result, true);
         $success == true;
         $db->query("update " . table('members') . " set `weixin_openid`='" . $fromUsername . "',`weixin_nick`='" . utf8_to_gbk($w_userinfo['nickname']) . "',bindingtime=" . time() . " where uid=" . $usinfo['uid']);
         require_once QISHI_ROOT_PATH . 'include/fun_wap.php';
         if (wap_user_login($username, $password)) {
             if (!empty($_SESSION['url'])) {
                 header("location:" . $_SESSION['url']);
                 unset($_SESSION['url']);
                 die;
             }
             $smarty->display('m/binding-success.html');
             die;
         }
     } else {
         $success = false;
     }
     if ($success == false) {
         $smarty->assign("from", $_POST['from']);
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:binding.php


示例4: iconv

 function iconv($in_charset, $out_charset, $str)
 {
     $in_charset = strtoupper($in_charset);
     $out_charset = strtoupper($out_charset);
     if (function_exists('mb_convert_encoding')) {
         return mb_convert_encoding($str, $out_charset, $in_charset);
     } else {
         pc_base::load_sys_func('iconv');
         $in_charset = strtoupper($in_charset);
         $out_charset = strtoupper($out_charset);
         if ($in_charset == 'UTF-8' && ($out_charset == 'GBK' || $out_charset == 'GB2312')) {
             return utf8_to_gbk($str);
         }
         if (($in_charset == 'GBK' || $in_charset == 'GB2312') && $out_charset == 'UTF-8') {
             return gbk_to_utf8($str);
         }
         return $str;
     }
 }
开发者ID:hw18708118867,项目名称:htmlmoban,代码行数:19,代码来源:global.func.php


示例5: curl_setopt

        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        $output = curl_exec($ch);
        curl_close($ch);
        $jsoninfo = json_decode($output, true);
        $nickname = iconv("utf-8", "gbk", $jsoninfo["nickname"]);
        require_once QISHI_ROOT_PATH . 'include/tpl.inc.php';
        $smarty->assign('title', '补充信息 - ' . $_CFG['site_name']);
        $smarty->assign('qqurl', "?act=");
        $smarty->assign('nickname', $nickname);
        $smarty->display('m/bind.html');
    }
} elseif ($act == 'reg_save') {
    if (empty($_SESSION["openid"])) {
        exit("openid is empty");
    }
    $val['username'] = !empty($_POST['username']) ? trim(utf8_to_gbk($_POST['username'])) : exit("输入用户名");
    $val['email'] = !empty($_POST['email']) ? trim($_POST['email']) : exit("输入邮箱");
    $val['member_type'] = intval($_POST['member_type']);
    $val['password'] = !empty($_POST['password']) ? trim($_POST['password']) : exit("输入密码");
    if ($val['password'] != trim($_POST['rpassword'])) {
        exit("密码不一致");
    }
    require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
    $db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
    unset($dbhost, $dbuser, $dbpass, $dbname);
    require_once QISHI_ROOT_PATH . 'include/fun_user.php';
    $sql = "select * from " . table("members") . " where username='{$val['username']}' or email='{$val['email']}'";
    $row = $db->getall($sql);
    if (!empty($row)) {
        exit("用户名或邮箱已经存在!");
    }
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:connect_qq_client.php


示例6: exit

     exit('repeat');
 }
 $addarr['realname'] = $realname;
 $addarr['email'] = $email;
 $addarr['mobile'] = $mobile;
 $addarr['personal_uid'] = intval($_SESSION['uid']);
 $addarr['course_id'] = $course['id'];
 $addarr['course_name'] = $course['course_name'];
 $addarr['train_id'] = $course['train_id'];
 $addarr['train_name'] = $course['trainname'];
 $addarr['train_uid'] = $course['uid'];
 $addarr['notes'] = $notes;
 if (strcasecmp(QISHI_DBCHARSET, "utf8") != 0) {
     $addarr['notes'] = utf8_to_gbk($addarr['notes']);
     $addarr['realname'] = utf8_to_gbk($addarr['realname']);
     $addarr['mobile'] = utf8_to_gbk($addarr['mobile']);
 }
 $addarr['apply_addtime'] = time();
 $addarr['personal_look'] = 1;
 if ($db->inserttable(table('personal_course_apply'), $addarr)) {
     $mailconfig = get_cache('mailconfig');
     $course['contact'] = $db->getone("select notify  from " . table('course_contact') . " where pid='{$course['id']}' LIMIT 1 ");
     $sms = get_cache('sms_config');
     $trainuser = get_user_info($course['uid']);
     if ($mailconfig['set_applycou'] == '1' && $trainuser['email_audit'] == '1' && $course['contact']['notify'] == '1') {
         dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_mail.php?uid={$_SESSION['uid']}&key=" . asyn_userkey($_SESSION['uid']) . "&act=set_applycou&course_id={$course['id']}&coursename={$course['course_name']}&personal_fullname={$realname}&email={$trainuser['email']}");
     }
     //sms
     if ($sms['open'] == "1" && $sms['set_applycou'] == "1" && $trainuser['mobile_audit'] == "1") {
         dfopen($_CFG['site_domain'] . $_CFG['site_dir'] . "plus/asyn_sms.php?uid={$_SESSION['uid']}&key=" . asyn_userkey($_SESSION['uid']) . "&act=set_applycou&course_id={$course['id']}&coursename={$course['course_name']}&personal_fullname={$realname}&mobile={$trainuser['mobile']}");
     }
开发者ID:winiceo,项目名称:job,代码行数:31,代码来源:user_apply_course.php


示例7: elseif

</table>

<table width="100%" border="0" cellspacing="5" cellpadding="0" id="error"  style="display:none">
  <tr>
    <td align="center" id="error_msg"></td>
  </tr>
</table>

<?php 
} elseif ($act == "app_save") {
    $setsqlarr['content'] = trim($_POST['content']) ? trim($_POST['content']) : exit("出错了");
    $setsqlarr['jobs_id'] = $_POST['jobs_id'] ? intval($_POST['jobs_id']) : exit("出错了");
    $setsqlarr['uid'] = intval($_SESSION['uid']);
    $setsqlarr['addtime'] = time();
    $setsqlarr['report_type'] = intval($_POST['report_type']);
    // 投诉类型
    if (strcasecmp(QISHI_DBCHARSET, "utf8") != 0) {
        $setsqlarr['content'] = utf8_to_gbk($setsqlarr['content']);
    }
    $jobsarr = app_get_jobs($setsqlarr['jobs_id']);
    if (empty($jobsarr)) {
        exit("职位丢失");
    } else {
        $setsqlarr['jobs_name'] = $jobsarr[0]['jobs_name'];
        $setsqlarr['jobs_addtime'] = $jobsarr[0]['addtime'];
        $insert_id = $db->inserttable(table('report'), $setsqlarr, 1);
    }
    if ($insert_id) {
        exit("ok");
    }
}
开发者ID:source-hunter,项目名称:74cms,代码行数:31,代码来源:user_report.php


示例8: array_map

        $jobs = array_map("addslashes", $jobs);
        if (check_jobs_apply($jobs['id'], $resumeid, $_SESSION['uid'])) {
            continue;
        }
        $addarr['job_id'] = $jobs['id'];
        $addarr['job_name'] = $jobs['jobs_name'];
        $addarr['company_id'] = $jobs['company_id'];
        $addarr['company_name'] = $jobs['companyname'];
        $addarr['company_uid'] = $jobs['uid'];
        $addarr['link_name'] = $link_name;
        $addarr['link_telephone'] = $link_telephone;
        $addarr['remark'] = $remark;
        if (strcasecmp(QISHI_DBCHARSET, "utf8") != 0) {
            $addarr['remark'] = utf8_to_gbk($addarr['remark']);
            $addarr['link_name'] = utf8_to_gbk($link_name);
            $addarr['link_telephone'] = utf8_to_gbk($link_telephone);
        }
        $addarr['addtime'] = time();
        $addarr['uid'] = $_SESSION["uid"];
        if ($db->inserttable(table('jobs_reward_clue'), $addarr)) {
            write_memberslog($_SESSION['uid'], 2, 1301, $_SESSION['username'], "提交了人才线索,职位:{$jobs['jobs_name']}");
        }
        $i = $i + 1;
    }
    if ($i == 0) {
        exit("repeat");
    } else {
        exit("ok");
    }
}
function reduce_user_sms($uid)
开发者ID:winiceo,项目名称:job,代码行数:31,代码来源:user_clue_jobs.php


示例9: receiveText

 private function receiveText($object)
 {
     $this->check_weixin_open($object);
     $keyword = trim($object->Content);
     $keyword = utf8_to_gbk($keyword);
     $keyword = addslashes($keyword);
     //自动回复模式
     $this->enterSearch($object, $keyword);
     if (is_array($this->content)) {
         if (isset($this->content[0]['PicUrl'])) {
             $result = $this->transmitNews($object, $this->content);
         }
     } else {
         $result = $this->transmitText($object, $this->content);
     }
     return $result;
 }
开发者ID:winiceo,项目名称:job,代码行数:17,代码来源:weixin.php


示例10: check_m_subsite_url

function check_m_subsite_url()
{
    global $dbhost, $dbuser, $dbpass, $dbname;
    require_once QISHI_ROOT_PATH . 'include/mysql.class.php';
    $db = new mysql($dbhost, $dbuser, $dbpass, $dbname);
    unset($dbhost, $dbuser, $dbpass, $dbname);
    $districtinfo = getIpLookup();
    if ($districtinfo === false) {
        return false;
    }
    $province = utf8_to_gbk($districtinfo['province']);
    $city = utf8_to_gbk($districtinfo['city']);
    $subinfo = $db->getone("select * from " . table('subsite') . " where s_effective=1 and (s_districtname like '%" . $province . "%' or s_districtname like '%" . $city . "%') order by s_id desc limit 1");
    if ($subinfo) {
        return array('disname' => $subinfo['s_districtname'], 'sitename' => $subinfo['s_sitename'], 'url' => 'http://' . ($subinfo['s_m_domain'] ? $subinfo['s_m_domain'] : $subinfo['s_domain'] . '/m/'));
    } else {
        return false;
    }
}
开发者ID:winiceo,项目名称:fenzhan,代码行数:19,代码来源:common.fun.php


示例11: trim

 }
 $setsqlarr['scale'] = trim($_POST['scale']) ? utf8_to_gbk(trim($_POST['scale'])) : exit('您选择公司规模!');
 $setsqlarr['scale_cn'] = utf8_to_gbk(trim($_POST['scale_cn']));
 $setsqlarr['registered'] = utf8_to_gbk(trim($_POST['registered']));
 $setsqlarr['currency'] = utf8_to_gbk(trim($_POST['currency']));
 $setsqlarr['address'] = trim($_POST['address']) ? utf8_to_gbk(trim($_POST['address'])) : exit('请填写通讯地址!');
 check_word($_CFG['filter'], $setsqlarr['address']) ? exit($_CFG['filter_tips']) : '';
 $setsqlarr['contact'] = trim($_POST['contact']) ? utf8_to_gbk(trim($_POST['contact'])) : exit('请填写联系人!');
 check_word($_CFG['filter'], $setsqlarr['contact']) ? exit($_CFG['filter_tips']) : '';
 $setsqlarr['telephone'] = trim($_POST['telephone']) ? utf8_to_gbk(trim($_POST['telephone'])) : exit('请填写联系电话!');
 check_word($_CFG['filter'], $setsqlarr['telephone']) ? exit($_CFG['filter_tips']) : '';
 $setsqlarr['email'] = trim($_POST['email']) ? utf8_to_gbk(trim($_POST['email'])) : exit('请填写联系邮箱!');
 check_word($_CFG['filter'], $setsqlarr['email']) ? exit($_CFG['filter_tips']) : '';
 $setsqlarr['website'] = utf8_to_gbk(trim($_POST['website']));
 check_word($_CFG['filter'], $setsqlarr['website']) ? exit($_CFG['filter_tips']) : '';
 $setsqlarr['contents'] = trim($_POST['contents']) ? utf8_to_gbk(trim($_POST['contents'])) : exit('请填写公司简介!');
 check_word($_CFG['filter'], $setsqlarr['contents']) ? exit($_CFG['filter_tips']) : '';
 $setsqlarr['yellowpages'] = intval($_POST['yellowpages']);
 $setsqlarr['contact_show'] = intval($_POST['contact_show']);
 $setsqlarr['email_show'] = intval($_POST['email_show']);
 $setsqlarr['telephone_show'] = intval($_POST['telephone_show']);
 $setsqlarr['address_show'] = intval($_POST['address_show']);
 if ($_CFG['company_repeat'] == "0") {
     $info = $db->getone("SELECT uid FROM " . table('company_profile') . " WHERE companyname ='{$setsqlarr['companyname']}' AND uid<>'{$_SESSION['uid']}' LIMIT 1");
     if (!empty($info)) {
         exit("{$setsqlarr['companyname']}已经存在,同公司信息不能重复注册");
     }
 }
 if ($company_profile) {
     $_CFG['audit_edit_com'] != "-1" ? $setsqlarr['audit'] = intval($_CFG['audit_edit_com']) : '';
     if (updatetable(table('company_profile'), $setsqlarr, " uid='{$uid}'")) {
开发者ID:dalinhuang,项目名称:yy,代码行数:31,代码来源:company_info.php


示例12: get_user_inusername

    }
    $user = get_user_inusername($usname);
    if (defined('UC_API')) {
        include_once QISHI_ROOT_PATH . 'uc_client/client.php';
        if (uc_user_checkname($usname) === 1 && empty($user)) {
            exit("true");
        } else {
            exit("false");
        }
    }
    empty($user) ? exit("true") : exit("false");
} elseif ($act == 'check_email') {
    require_once QISHI_ROOT_PATH . 'include/fun_user.php';
    $email = trim($_POST['email']);
    if (strcasecmp(QISHI_DBCHARSET, "utf8") != 0) {
        $email = utf8_to_gbk($email);
    }
    $user = get_user_inemail($email);
    if (defined('UC_API')) {
        include_once QISHI_ROOT_PATH . 'uc_client/client.php';
        if (uc_user_checkemail($email) === 1 && empty($user)) {
            exit("true");
        } else {
            exit("false");
        }
    }
    empty($user) ? exit("true") : exit("false");
} elseif ($act == "top_loginform") {
    $contents = '';
    if ($_COOKIE['QS']['username'] && $_COOKIE['QS']['password']) {
        $contents = '欢迎&nbsp;&nbsp;<a href="{#$user_url#}" style="color:#339900">{#$username#}</a> 登录!&nbsp;&nbsp;{#$pmscount_a#}&nbsp;&nbsp;&nbsp;&nbsp;<a href="{#$user_url#}">[会员中心]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="{#$logout_url#}" >[退出]</a>';
开发者ID:winiceo,项目名称:job,代码行数:31,代码来源:ajax_user.php


示例13: report_deal

                report_deal($_SESSION['uid'], 2, $jobfair['predetermined_point']);
                $user_points = get_user_points($_SESSION['uid']);
                write_memberslog($_SESSION['uid'], 1, 9001, $_SESSION['username'], "预定了招聘会 《{$jobfair['title']}》 的展位,(-{$jobfair['predetermined_point']}),(剩余:{$user_points})", 1, 1019, "预定招聘会展位", "-{$jobfair['predetermined_point']}", "{$user_points}");
            } elseif ($_CFG['operation_mode'] == '2') {
                action_user_setmeal($_SESSION['uid'], 'jobsfair_num');
                $jobsfair_num = $setmeal['jobsfair_num'] - 1;
                write_memberslog($_SESSION['uid'], 1, 9002, $_SESSION['username'], "预定了招聘会 《{$jobfair['title']}》 的展位,剩余参加招聘会{$jobsfair_num}场次", 2, 1019, "预定招聘会展位", "1", "{$jobsfair_num}");
            }
            write_memberslog($_SESSION['uid'], 1, 1401, $_SESSION['username'], "预定了招聘会 《{$jobfair['title']}》 的展位");
            exit("预定成功!");
        }
    }
} elseif ($act == "salary_search") {
    if (strcasecmp(QISHI_DBCHARSET, "utf8") != 0) {
        $_GET['category'] = utf8_to_gbk($_GET['category']);
        $_GET['district'] = utf8_to_gbk($_GET['district']);
    }
    unset($_GET['act']);
    $param = array_map("rawurlencode", $_GET);
    $url = $_CFG['wap_domain'] . '/salary.php?category=' . $param['category'] . '&district=' . $param['district'];
    unset($_GET, $param);
    exit($url);
}
//获取职位或者简历的所属UID
function get_uid($aid, $type = 'jobs')
{
    global $db;
    if ($type == 'resume') {
        $table = table('resume');
    } else {
        $table = table('jobs');
开发者ID:winiceo,项目名称:job,代码行数:31,代码来源:ajax.php


示例14: get_user_inemail

    }
    $user = get_user_inemail($email);
    if (defined('UC_API')) {
        include_once QISHI_ROOT_PATH . 'uc_client/client.php';
        if (uc_user_checkemail($email) === 1 && empty($user)) {
            exit("true");
        } else {
            exit("false");
        }
    }
    empty($user) ? exit("true") : exit("false");
} elseif ($act == "check_mobile") {
    require_once QISHI_ROOT_PATH . 'include/fun_user.php';
    $mobile = trim($_POST['mobile']);
    if (strcasecmp(QISHI_DBCHARSET, "utf8") != 0) {
        $mobile = utf8_to_gbk($mobile);
    }
    if (!preg_match("/^(13|14|15|18|17)\\d{9}\$/", $mobile)) {
        exit("false");
    }
    $user = get_user_inmobile($mobile);
    empty($user) ? exit("true") : exit("false");
} elseif ($act == "top_loginform") {
    $block = isset($_GET['block']) ? iconv('utf-8', QISHI_CHARSET, $_GET['block']) : '';
    $contents = '';
    if ($_COOKIE['QS']['username'] && $_COOKIE['QS']['password']) {
        // $contents='欢迎&nbsp;&nbsp;<a href="{#$user_url#}" style="color:#339900">{#$username#}</a> 登录!&nbsp;&nbsp;{#$pmscount_a#}&nbsp;&nbsp;&nbsp;&nbsp;<a href="{#$user_url#}" style="color:#0066cc">[会员中心]</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="{#$logout_url#}" style="color:#0066cc">[退出]</a>';
        $contents = '<span class="login-reg"><a href="{#$user_url#}" class="underline">{#$username#}</a>&nbsp;&nbsp;&nbsp;<a href="{#$logout_url#}" class="underline">[退出]</a></span>';
    } elseif ($_SESSION['activate_username'] && defined('UC_API')) {
        $contents = '<span class="login-reg">您的帐号{#$activate_username#}需激活后才可以使用! &nbsp;&nbsp;&nbsp;<a href="{#$activate_url#}" class="underline">[立即激活]</a></span>';
    } else {
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:ajax_user.php


示例15: utf8_to_gbk

function utf8_to_gbk($arr)
{
    if (empty($arr)) {
        return false;
    }
    if (is_array($arr)) {
        foreach ($arr as $key => $value) {
            $keyN = mb_convert_encoding($key, 'GBK', 'UTF-8');
            if ($keyN != $key) {
                unset($arr[$key]);
            }
            $arr[$keyN] = utf8_to_gbk($value);
        }
    } else {
        if (!empty($arr)) {
            $arr = mb_convert_encoding($arr, 'GBK', 'UTF-8');
        }
    }
    return $arr;
}
开发者ID:relunctance,项目名称:Relunctance,代码行数:20,代码来源:Function.php


示例16: elseif

} elseif ($act == 'save_credent') {
    $id = intval($_POST['id']);
    $setsqlarr['uid'] = intval($_SESSION['uid']);
    $setsqlarr['pid'] = intval($_REQUEST['pid']);
    if ($setsqlarr['uid'] == 0 || $setsqlarr['pid'] == 0) {
        exit('简历不存在!');
    }
    $resume_basic = get_resume_basic(intval($_SESSION['uid']), intval($_REQUEST['pid']));
    if (empty($resume_basic)) {
        exit("请先填写简历基本信息!");
    }
    $resume_language = get_resume_language($_SESSION['uid'], $_REQUEST['pid']);
    if (count($resume_language) >= 6) {
        exit('证书不能超过6条!');
    }
    $credent = utf8_to_gbk(trim($_POST['credent']));
    check_word($_CFG['filter'], $setsqlarr['credent']) ? exit($_CFG['filter_tips']) : '';
    $setsqlarr['name'] = $credent ? $credent : exit("请填写证书名称!");
    $setsqlarr['year'] = intval($_POST['credent_year']) ? intval($_POST['credent_year']) : exit("请选择年!");
    $setsqlarr['month'] = intval($_POST['credent_month']) ? intval($_POST['credent_month']) : exit("请选择月!");
    if ($id) {
        $db->updatetable(table("resume_credent"), $setsqlarr, array("id" => $id));
        exit("success");
    } else {
        $insert_id = $db->inserttable(table("resume_credent"), $setsqlarr, 1);
        if ($insert_id) {
            check_resume($_SESSION['uid'], intval($_REQUEST['pid']));
            perfect_resume($_SESSION['uid'], $_SESSION['username'], intval($_REQUEST['pid']));
            exit("success");
        } else {
            exit("err");
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:personal_resume.php


示例17: unset

    $db->updatetable(table('jobs_search_wage'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}' ");
    $db->updatetable(table('jobs_search_rtime'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}' ");
    $db->updatetable(table('jobs_search_stickrtime'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}' ");
    $db->updatetable(table('jobs_search_hot'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}' ");
    $db->updatetable(table('jobs_search_scale'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}'");
    $searchtab['key'] = $setsqlarr['key'];
    $searchtab['likekey'] = $setsqlarr['jobs_name'] . ',' . $company_profile['companyname'];
    $db->updatetable(table('jobs_search_key'), $searchtab, " id='{$id}' AND uid='{$_SESSION['uid']}' ");
    unset($searchtab);
    add_jobs_tag(intval($_POST['id']), $_SESSION['uid'], $_POST['tag']) ? "" : showmsg('保存失败!', 0);
    distribution_jobs($id, $_SESSION['uid']);
    write_memberslog($_SESSION['uid'], $_SESSION['utype'], 2002, $_SESSION['username'], "修改了职位:{$setsqlarr['jobs_name']},职位ID:{$id}");
    showmsg("修改成功!", 2, $link);
} elseif ($act == "ajax_save_jobs_templates") {
    foreach ($_POST as $key => $value) {
        $_POST[$key] = utf8_to_gbk($value);
    }
    $setsqlarr['title'] = !empty($_POST['jobs_name']) ? trim($_POST['jobs_name']) . "的模板" : exit('-1');
    $setsqlarr['uid'] = intval($_SESSION['uid']);
    $setsqlarr['contents'] = !empty($_POST['contents']) ? trim($_POST['contents']) : exit('-1');
    $setsqlarr['nature'] = intval($_POST['nature']);
    $setsqlarr['nature_cn'] = trim($_POST['nature_cn']);
    $setsqlarr['sex'] = intval($_POST['sex']);
    $setsqlarr['sex_cn'] = trim($_POST['sex_cn']);
    $setsqlarr['amount'] = intval($_POST['amount']);
    $setsqlarr['topclass'] = intval($_POST['topclass']);
    $setsqlarr['category'] = !empty($_POST['category']) ? intval($_POST['category']) : exit('-1');
    $setsqlarr['subclass'] = intval($_POST['subclass']);
    $setsqlarr['category_cn'] = trim($_POST['category_cn']);
    $setsqlarr['subsite_id'] = !empty($_POST['subsite_id']) ? intval($_POST['subsite_id']) : showmsg('请选择工作地区!', 1);
    $setsqlarr['district'] = !empty($_POST['district']) ? intval($_POST['district']) : exit('-1');
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:company_jobs.php


示例18: cut_str

         $addarr['resume_name'] = cut_str($resume['fullname'], 1, 0, "女士");
     }
 } else {
     $addarr['resume_name'] = $resume['fullname'];
 }
 $addarr['resume_uid'] = $resume['uid'];
 $addarr['hunter_id'] = $hunter_profile['id'];
 $addarr['hunter_addtime'] = $hunter_profile['addtime'];
 $addarr['hunter_name'] = $hunter_profile['huntername'];
 $addarr['hunter_uid'] = $_SESSION['uid'];
 $addarr['jobs_id'] = $jobs['id'];
 $addarr['jobs_name'] = $jobs['jobs_name'];
 $addarr['jobs_addtime'] = $jobs['addtime'];
 $addarr['notes'] = $notes;
 if (strcasecmp(QISHI_DBCHARSET, "utf8") != 0) {
     $addarr['notes'] = utf8_to_gbk($addarr['notes']);
 }
 $addarr['personal_look'] = 1;
 $addarr['interview_addtime'] = time();
 $addarr['interview_time'] = $interview_time;
 $resume_user = get_user_info($resume['uid']);
 $resume_user = array_map("addslashes", $resume_user);
 if ($_CFG['operation_hunter_mode'] == "2") {
     $db->inserttable(table('hunter_interview'), $addarr);
     if ($resume['talent'] == '2') {
         action_user_setmeal($_SESSION['uid'], "interview_senior");
         $setmeal = get_user_setmeal($_SESSION['uid']);
         write_memberslog($_SESSION['uid'], 1, 9002, $_SESSION['username'], "邀请了 {$resume_user['username']} 面试,还可以邀请高级人才 {$setmeal['interview_senior']} 次", 2, 1007, "邀请高级人才面试", "1", "{$setmeal['interview_senior']}");
         write_memberslog($_SESSION['uid'], 1, 6001, $_SESSION['username'], "邀请了 {$resume_user['username']} 面试");
     } else {
         action_user_setmeal($_SESSION['uid'], "interview_ordinary");
开发者ID:winiceo,项目名称:job,代码行数:31,代码来源:user_hunter_invited.php


示例19: convert

/**
 * 编码转换函数
 * @param  $str 
 * @param  $from 
 * @param  $to
 * @return string
 */
function convert($str, $from = 'gbk', $to = 'utf-8')
{
    if (!$str) {
        return '';
    }
    if (strtolower($from) == strtolower($to)) {
        return $str;
    }
    $to = str_replace('gb2312', 'gbk', strtolower($to));
    $from = str_replace('gb2312', 'gbk', strtolower($from));
    if ($form == 'gbk' && $to == 'utf-8') {
        return gbk_to_utf8($str);
    } elseif ($form == 'utf-8' && $to == 'gbk') {
        return utf8_to_gbk($str);
    } else {
        return $str;
    }
}
开发者ID:kennyhonghui,项目名称:zhuoxi,代码行数:25,代码来源:function.php


示例20: elseif

    }
} elseif ($act == 'img_title') {
    global $_CFG;
    $id = intval($_GET['id']);
    $uid = intval($_SESSION['uid']);
    $img = $db->getone("SELECT * FROM " . table('company_img') . " WHERE uid ='{$uid}' AND id='{$id}' LIMIT 1");
    $tpl = '../../templates/' . $_CFG['template_dir'] . "member_company/ajax_set_img_title.htm";
    $contents = file_get_contents($tpl);
    $contents = str_replace('{#$id#}', $id, $contents);
    $contents = str_replace('{#$title#}', $img['title'], $contents);
    $contents = str_replace('{#$addtime#}', date('Y-m-d', $img['addtime']), $contents);
    $contents = str_replace('{#$site_template#}', $_CFG['site_template'], $contents);
    exit($contents);
} elseif ($act == 'img_title_save') {
    $id = intval($_POST['id']) ? intval($_POST['id']) : exit("-1");
    $title = trim($_POST['title']) ? utf8_to_gbk($_POST['title']) : exit("-1");
    if ($db->query("update  " . table('company_img') . " SET title='{$title}'  WHERE id='{$id}'  LIMIT 1")) {
        exit('1');
    } else {
        exit('2');
    }
} elseif ($act == 'order_detail') {
    $uid = intval($_SESSION['uid']);
    $order_id = intval($_GET['order_id']) ? intval($_GET['order_id']) : exit("订单编号丢失!");
    $order = $db->getone("SELECT * FROM " . table('order') . " WHERE uid ='{$uid}' AND id='{$order_id}' LIMIT 1");
    $tpl = '../../templates/' . $_CFG['template_dir'] . "member_company/ajax_order_detail.htm";
    $contents = file_get_contents($tpl);
    $contents = str_replace('{#$order_oid#}', $order['oid'], $contents);
    $contents = str_replace('{#$order_addtime#}', date('Y-m-d', $order['addtime']), $contents);
    if ($order['is_paid'] == '1') {
        $contents = str_replace('{#$order_is_paid#}', '未完成', $contents);
开发者ID:winiceo,项目名称:job,代码行数:31,代码来源:company_ajax.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP utf8_to_unicode函数代码示例发布时间:2022-05-23
下一篇:
PHP utf8_to_ascii函数代码示例发布时间: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