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


PHP XString::convertEncoding方法代码示例

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


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

示例1: callback

 public function callback($request,$response)
 {
     if (md5($request->msg_id . $request->task_id . $request->fault_time . BeanFinder::get('configs')->jiankongbaoToken)
         == $request->token)
     {
         $content = XString::convertEncoding($request->content, 'gbk', 'utf-8');
         SMSClient::getInstance()->sendSMS(HdfPhoneNumber::$opsPhoneNumbers, $content.' by jkb');
         echo 'OK';
         return parent::DIRECT_OUTPUT;
     }
     echo 'INVALID';
     return parent::DIRECT_OUTPUT;
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:13,代码来源:monitorcontroller.php

示例2: processInputData

 private function processInputData($request, $databucketObj, $action)
 {/*{{{*/
     $requestArgs = $request->collectAllRequest();
     self::_log($requestArgs);
     $rm = new ReflectionMethod($databucketObj, $action);
     $inputs = array();
     foreach($rm->getParameters() as $parameter)
     {
         $paramName = $parameter->getName();
         if(isset($requestArgs[$paramName]))
         {
             $inputs[] = $requestArgs[$paramName];
         }
         else
         {
             $inputs[] = null;
         }
     }
     return XString::convertEncoding($inputs, 'GBK', 'UTF-8');
 }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:20,代码来源:mobileapi.php

示例3: build

    public function build()
    {/*{{{*/
        $this->myEcho("\n处理: ".get_class($this)."\n");
        $this->totalTimes = $this->getTotalDBTimes();
        $this->myEcho('数据获取次数: '.$this->totalTimes.' ('.$this->stepLen."条/次)\n");
        $this->myEcho('标准模版路径: '.$this->workPath."\n\n");
        $nowTimes= 1;
        $dataPond = array();
        XString::clearDir($this->workPath);
        $this->nowFile = 0;

        do{
            $this->myEcho('   #'.$nowTimes.' 读取');
            $datas = null;
            $datas = $this->getData($nowTimes, $this->stepLen);
            $this->myEcho(' -> 切片 ');
            $dataPond = $this->edward->shred($datas, $nowTimes, $this->totalTimes);
            $this->myEcho((string)$this->edward);

            if (count($dataPond))
            {
                $this->myEcho(' -> 保存');
            }
            foreach($dataPond as $data)
            {
                $this->myEcho(' '.$this->nowFile.'.'.self::SUFFIX_XML);
                $data = XString::convertEncoding($data, $this->charset, 'gbk');
                $this->write2File($data);
                unset($data);
                if($this->fileCntLimit != 0 && $this->nowFile >= $this->fileCntLimit)
                {
                    break 2;
                }
            }

            $nowTimes++;
            unset($dataPond);
            $this->myEcho("\n");
        } while ($nowTimes <= $this->totalTimes + 1);
    }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:40,代码来源:opendatasource.php

示例4: array

<?php

$keyWords = array();
if (isset($proposal) && false == $proposal->isNull()) {
    $bingLiSet = BingLiDtoClient::getInstance()->getBingLiByRelatedObj($proposal);
    $bingLiSetArray = BingLiDto::transBingLiDtoInfos2Array($bingLiSet);
    $sensitiveWords = BeanFinder::get('ContentFilter')->getSensitiveWordsRecursive("Flow", $bingLiSetArray);
    $words = $proposal->getNecessaryWords();
    $keyWords = array_values(array_unique(array_merge($sensitiveWords, $words)));
}
?>

<script type="text/javascript" src="http://i1.hdfimg.com/js/highlighter/highlight.js?1"></script>
<script>
function highlightWords()
{
    heightLight($('.highlight'), <?php 
echo json_encode(XString::convertEncoding($keyWords, 'utf-8', 'gbk'));
?>
);
}
window.onload=highlightWords;

</script>

开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:24,代码来源:_proposalforhighlight.php

示例5: json_encode

<?php

if (isset($content)) {
    echo json_encode(XString::convertEncoding($content, 'utf8', 'gbk'));
}
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:5,代码来源:jsoncontent.php

示例6: ajaxGenTask

 /**
  * 生成任务
  *
  * 此方法是产生新的任务
  *
  * 逻辑:
  * 根据选择的source(proposal)来产生新的task,不判断当前task是否已经有未完成的任务,
  * 每次产生新的任务。
  * 
  * @param mixed $request 
  * @param mixed $response 
  * @access public
  * @return void
  */
 public function ajaxGenTask($request, $response)
 {
     /*{{{*/
     $toGroupId = $request->togroupid;
     DBC::requireFalse(empty($toGroupId), "togroupid 不可为空");
     $fromGroupId = $request->fromgroupid;
     DBC::requireFalse(empty($fromGroupId), "fromgroupid 不可为空");
     $fromGroup = InspectGroup::find($fromGroupId);
     $source = DAL::get()->mustFind($request->sourcetype, $request->sourceid);
     $taskLevel = $request->getRequest('tasklevel', 0);
     $isCreateSaleTask = $this->preIsCreateSaleTask($request, $response);
     if (null == $request->tasklevel && false == empty($isCreateSaleTask)) {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('级别是必填项', 'utf-8', 'gbk')));
         return parent::DIRECT_OUTPUT;
     }
     $comment = XString::convertToGbk($request->comment);
     $src = $request->getRequest('tasksrc', '0');
     $toGroup = $this->getTaskGroup($toGroupId, $src, $source, $fromGroup, $taskLevel);
     if (empty($comment)) {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('转任务备注是必填项', 'utf-8', 'gbk')));
         return parent::DIRECT_OUTPUT;
     }
     if ($toGroup instanceof SaleInspectGroup && empty($src)) {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('来源是必填项', 'utf-8', 'gbk')));
         return parent::DIRECT_OUTPUT;
     }
     if ($toGroup instanceof InitialInspectGroup) {
         $this->genInitialTask($fromGroup, $toGroup, $source, $taskLevel, $comment, $src);
     } else {
         $this->genBuTask($fromGroup, $toGroup, $source, $taskLevel, $comment, $src, $request->ticketid);
     }
     echo json_encode(array('success' => 1, 'msg' => XString::convertEncoding('转任务成功', 'utf-8', 'gbk')));
     return parent::DIRECT_OUTPUT;
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:48,代码来源:intentioncontroller.php

示例7: testDiseaseHospitalWithArea

    public function testDiseaseHospitalWithArea()
    {/*{{{*/
        //标准 数据
        $standardFileList = $this->standardData(__FUNCTION__);
        $standardFile = array_pop($standardFileList);
        $this->assertTrue(isset($standardFileList),"before transform, standardFileList is null...");

        $standardDiseaseHospitalInfo = $this->xmlData($standardFile);
        $keys = array('key','url','showurl','date','title','content1','pagesize','form');
        $this->keyExists($standardDiseaseHospitalInfo, $keys);

        //$this->valueExists($standardDiseaseHospitalInfo);
        $standHospitalList = $standardDiseaseHospitalInfo['form'];
        $this->assertTrue(count($standHospitalList) == 5, "before tansform, the count of form is not 5"); 

        //xslt 转换后数据
        $completeFileList = $this->completeData(__FUNCTION__);
        $completeFile = array_pop($completeFileList);
        $this->assertTrue(isset($completeFile));

        $completeDiseaseHospitalInfo = $this->xmlData($completeFile);
        $this->keyExists($completeDiseaseHospitalInfo, array('key', 'display'));
        $keys = array('url', 'showurl','date','title','content1','pagesize','form'); 
        $this->keyExists($completeDiseaseHospitalInfo['display'], $keys);

        $completeDiseaseInfo = XString::convertEncoding($completeDiseaseHospitalInfo, 'gbk', 'utf-8');
        $completeHospitalList = $completeDiseaseHospitalInfo['display']['form'];
        $this->assertTrue(isset($completeHospitalList) && count($completeHospitalList) == 6, "form has wrong");

    }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:30,代码来源:datasource.php

示例8: initCallBackData

 public function initCallBackData(array $data, $name)
 {
     /*{{{*/
     $sign = $data["sign"];
     $content = "notify_data=" . $data["notify_data"];
     $res = $this->verify($content, $sign);
     if (false == $res) {
         return $res;
     } else {
         $out_trade_no = $this->getDataForXML($data["notify_data"], '/notify/out_trade_no');
         list($sn, $type) = Pay::explodeSN($out_trade_no);
         Pay::checkNameInValidNames($name);
         $this->sn = $sn;
         $this->name = $name;
         $this->type = Pay::$typeDescs[$type];
         $arrcontent = XString::xmlToArray($data["notify_data"]);
         $arrcontent['name'] = $name;
         $arrcontent = XString::convertEncoding($arrcontent, 'gbk', 'utf8');
         $this->content = $arrcontent;
         $this->total_fee = $this->getDataForXML($data["notify_data"], '/notify/total_fee');
         $this->total_fee = (array) $this->total_fee;
         $this->total_fee = $this->total_fee[0];
         $this->trade_status = $this->getDataForXML($data["notify_data"], '/notify/trade_status');
         $this->trade_status = (array) $this->trade_status;
         $this->trade_status = $this->trade_status[0];
         $this->data = $arrcontent;
         return $this;
     }
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:29,代码来源:wapalipay.php

示例9: ajaxCreateMaintenanceDoctorTask

 public function ajaxCreateMaintenanceDoctorTask($request, $response)
 {
     /*{{{*/
     $comment = $request->comment;
     $taskLevel = $request->tasklevel;
     $comment = XString::convertToGbk($comment);
     $taskId = HdfTaskClient::getInstance()->createMaintenanceDoctorTask($comment, $this->curInspector, $taskLevel);
     if (false == empty($taskId)) {
         echo json_encode(array('success' => 1, 'msg' => XString::convertEncoding('成功生成任务', 'utf-8', 'gbk')));
     } else {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('生成任务失败', 'utf-8', 'gbk')));
     }
     return parent::DIRECT_OUTPUT;
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:14,代码来源:doctormanagercontroller.php

示例10: initCallBackData

 public function initCallBackData(array $data, $name)
 {
     /*{{{*/
     $waperAlipayFunction = wap_alipay_function::getInstance();
     $out_trade_no = $waperAlipayFunction->getDataForXML($data["notify_data"], '/notify/out_trade_no');
     list($sn, $type) = Pay::explodeSN($out_trade_no);
     Pay::checkNameInValidNames($name);
     $this->sn = $sn;
     $this->name = $name;
     $this->type = Pay::$typeDescs[$type];
     $arrcontent = XString::xmlToArray($data["notify_data"]);
     $arrcontent['name'] = $name;
     $arrcontent = XString::convertEncoding($arrcontent, 'gbk', 'utf8');
     $this->content = $arrcontent;
     $this->total_fee = $waperAlipayFunction->getDataForXML($data["notify_data"], '/notify/total_fee');
     $this->total_fee = (array) $this->total_fee;
     $this->total_fee = $this->total_fee[0];
     $this->trade_status = $waperAlipayFunction->getDataForXML($data["notify_data"], '/notify/trade_status');
     $this->trade_status = (array) $this->trade_status;
     $this->trade_status = $this->trade_status[0];
     $this->data = $arrcontent;
     return $this;
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:23,代码来源:waperalipay.php

示例11: updateWrapper

 public function updateWrapper($request, $response)
 {
     /*{{{*/
     DBC::requireNotEmptyString($request->id, '问题包id不可为空!');
     $arr = XString::convertEncoding($_REQUEST, 'gbk', 'utf8');
     $wrapper = WendaClient::getInstance()->modifyQuestionWrapper($request->id, $arr['wrappername'], $arr['wrapperinterval']);
     echo '{"res":"success", "name":"' . $wrapper->name . '", "interval":"' . $wrapper->intervalDay . '"}';
     return self::DIRECT_OUTPUT;
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:9,代码来源:patientfilecontroller.php

示例12: formatOutput

 private function formatOutput($os)
 {/*{{{*/
     if($os == MobileApi::IOS)
     {
         $preg = "/<script[\s\S]*?<\/script>/i";
         $info = json_encode(XString::convertEncoding($this->info, 'utf8', 'gbk'));
         $this->info = preg_replace($preg,"",$info);
     }
     else
     {
         $this->info = json_encode(XString::convertEncoding($this->info, 'utf8', 'gbk'));
     }
 }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:13,代码来源:mobileapioutput.php

示例13: ajaxBindPatient

 public function ajaxBindPatient($request, $response)
 {
     /*{{{*/
     $patientCaseId = $request->patientcaseid;
     $patientIds = $request->patientids;
     $patientCase = DAL::get()->find('patientcase', $patientCaseId);
     if ($patientCase->isNull()) {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('要绑定的病例头不存在', 'utf-8', 'gbk')));
         return parent::DIRECT_OUTPUT;
     }
     if (empty($patientIds)) {
         echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('要绑定的病人不能为空', 'utf-8', 'gbk')));
         return parent::DIRECT_OUTPUT;
     }
     $patientList = DAL::get()->find('patient', $patientIds);
     foreach ($patientList as $patient) {
         if ($patient->isNull()) {
             echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('要绑定的病人Id' . +$patient->id . '不存在', 'utf-8', 'gbk')));
             return parent::DIRECT_OUTPUT;
         }
         $ref = DAL::get()->find_by_patientid_and_patientcaseid('patientcaseref', $patient->id, $patientCase->id);
         if (false == $ref->isNull() && $ref->isMatch()) {
             echo json_encode(array('success' => 0, 'msg' => XString::convertEncoding('要绑定的病人:' . $patient->name . '与病例头:' . $patientCase->name . '已经存在关联', 'utf-8', 'gbk')));
             return parent::DIRECT_OUTPUT;
         }
     }
     $patientIds = array_keys($patientList);
     PatientCourseClient::getInstance()->addPatientCaseRef($patientIds, $patientCase->id, $this->curInspector);
     echo json_encode(array('success' => 1, 'msg' => XString::convertEncoding('绑定成功', 'utf-8', 'gbk')));
     return parent::DIRECT_OUTPUT;
 }
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:31,代码来源:outpatienttoolcontroller.php

示例14: replyTplAjaxUpdatePost

	public function replyTplAjaxUpdatePost($request, $response)
	{
        ReplyTemplateClient::getInstance()->modify($this->_newUser, $request->id, XString::convertEncoding($request->getRequest('content'), 'gbk', 'utf-8'));
		
		$result = array('status' => 0, 'content' => mb_substr($request->getRequest('content'), 0, 110, 'utf-8'));
        echo json_encode($result);
        exit;
	}
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:8,代码来源:adminthreadcontroller.php

示例15: ajaxGetContractIds

 public function ajaxGetContractIds($request, $response)
 {/*{{{*/
     header('Content-Type: text/html; charset=gbk');
     $groupId = $request->groupId;
     $group = DAL::get()->find('telgroup', $groupId);
     $telOwner = DAL::get()->find_by_relatedObject('telowner', $group);
     $contractInfos = array();
     if (false == $telOwner->isNull())
     {
         $telcontractList = $telOwner->getConfirmedContractList(); 
         foreach ($telcontractList as $telcontract)
         {
             $appointment = $telcontract->service->relatedObject;
             $contractInfos[$telcontract->id] = "{$appointment->minute}分钟/{$appointment->price}元";
         }
     }
     $contractInfos = XString::convertEncoding($contractInfos, 'utf8', 'gbk');
     echo json_encode($contractInfos);
     return parent::DIRECT_OUTPUT;
 }/*}}}*/
开发者ID:sdgdsffdsfff,项目名称:hdf-client,代码行数:20,代码来源:telordercontroller.php


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