當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。