本文整理汇总了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;
}
示例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');
}/*}}}*/
示例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);
}/*}}}*/
示例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>
示例5: json_encode
<?php
if (isset($content)) {
echo json_encode(XString::convertEncoding($content, 'utf8', 'gbk'));
}
示例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;
}
示例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");
}/*}}}*/
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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'));
}
}/*}}}*/
示例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;
}
示例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;
}
示例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;
}/*}}}*/