本文整理汇总了PHP中diconv函数的典型用法代码示例。如果您正苦于以下问题:PHP diconv函数的具体用法?PHP diconv怎么用?PHP diconv使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了diconv函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_playlist_byid
function get_playlist_byid($id)
{
$params['client_id'] = "f1652f5ab2517d4d";
$params['playlist_id'] = $id;
$params['count'] = 100;
$base_url = "https://openapi.youku.com/v2/playlists/videos.json";
$url = $base_url . "?" . http_build_query($params);
$s = file_data($url);
$result = json_decode($s, true);
$video = $result['videos'];
if (empty($video)) {
return false;
}
$result['videoname'] = array();
$result['videolink'] = array();
$result['videoimg'] = array();
$result['videotime'] = array();
foreach ($video as $vk => $vv) {
//http://player.56.com/cpm_MTA4NzEzNDUz.swf
$result['videoname'][$vk] = diconv($vv['title'], "utf-8");
$result['videolink'][$vk] = 'http://player.youku.com/player.php/Type/Folder/Fid/19466264/Ob/1/sid/' . $vv['id'] . '/v.swf';
$result['videoimg'][$vk] = $vv['thumbnail'];
$result['videotime'][$vk] = strtotime($vv['published']);
}
unset($result['videos']);
return $result;
}
示例2: mobileoutput
public static function mobileoutput()
{
global $_G;
if (!defined('TPL_DEFAULT')) {
$content = ob_get_contents();
ob_end_clean();
$content = preg_replace("/href=\"(\\w+\\.php)(.*?)\"/e", "mobilereplace('\\1', '\\2')", $content);
ob_start();
$content = '<?xml version="1.0" encoding="utf-8"?>' . $content;
if ('utf-8' != CHARSET) {
@header('Content-Type: text/html; charset=utf-8');
$content = diconv($content, CHARSET, 'utf-8');
}
echo $content;
exit;
} elseif (defined('TPL_DEFAULT') && !$_G['cookie']['dismobilemessage'] && $_G['mobile']) {
ob_end_clean();
ob_start();
$_G['forcemobilemessage'] = true;
$query_sting_tmp = str_replace(array('&mobile=yes', 'mobile=yes'), array(''), $_SERVER['QUERY_STRING']);
$_G['setting']['mobile']['pageurl'] = $_G['siteurl'] . substr($_G['PHP_SELF'], 1) . ($query_sting_tmp ? '?' . $query_sting_tmp . '&mobile=no' : '?mobile=no');
unset($query_sting_tmp);
dsetcookie('dismobilemessage', '1', 3600);
showmessage('not_in_mobile');
exit;
}
}
示例3: _convert
private static function _convert($post)
{
foreach ($post as $k => $v) {
$post[$k] = diconv($v, CHARSET, 'UTF-8');
}
return $post;
}
示例4: get_album_by_aid
function get_album_by_aid($aid)
{
$params['aid'] = $aid;
$url = "http://oapi.56.com/album/info.json";
$url = $url . '?' . signRequest($params);
$s = file_get_contents($url);
$result = json_decode($s, true);
$video = $result[videolist][data];
if (empty($video)) {
return false;
}
$result['videoname'] = array();
$result['videolink'] = array();
$result['videoimg'] = array();
$result['videotime'] = array();
foreach ($video as $vk => $vv) {
//http://player.56.com/cpm_MTA4NzEzNDUz.swf
$result['videoname'][$vk] = diconv($vv['video_title'], "utf-8");
$result['videolink'][$vk] = 'http://player.56.com/w_' . $vv['video_id'];
$result['videolink'][$vk] .= base64_decode("LnN3Zi8xMDMxX3NtYXJ0Y29tZS5zd2Y=");
$result['videoimg'][$vk] = $vv['video_cover'];
$result['videotime'][$vk] = $vv['add_time'];
}
unset($result[videolist][data]);
return $result;
}
示例5: build_cache_creditrule
function build_cache_creditrule()
{
$data = array();
foreach (C::t('common_credit_rule')->fetch_all_rule() as $rule) {
$rule['rulenameuni'] = urlencode(diconv($rule['rulename'], CHARSET, 'UTF-8', true));
$data[$rule['action']] = $rule;
}
savecache('creditrule', $data);
}
示例6: makeDownloadurl
public function makeDownloadurl($sha1, $filesize, $filename)
{
global $_G;
$filename = trim($filename, ' "');
// Discuz! 默认的filename两侧会加上 双引号
$filename = diconv($filename, CHARSET, 'UTF-8');
$filename = $this->str2hex($filename);
$filename = strtolower($filename[1]);
$post = 'http://dz.xf.qq.com/ftn.php?v=1&&';
$k = self::$_util->hashHmac('sha1', sprintf('%s|%s|%s', $sha1, $_G['timestamp'], self::$_siteId), self::$_encKey);
$parm = array('site_id' => self::$_siteId, 't' => $_G['timestamp'], 'sha1' => $sha1, 'filesize' => $filesize, 'filename' => $filename, 'k' => $k, 'ip' => $_G['clientip']);
return $post . self::$_util->httpBuildQuery($parm, '', '&&');
}
示例7: make_downloadurl
function make_downloadurl($sha1, $filesize, $filename)
{
global $_G;
$filename = trim($filename, ' "');
// Discuz! 默认的filename两侧会加上 双引号
$filename = diconv($filename, CHARSET, 'UTF-8');
$filename = str2hex($filename);
$filename = strtolower($filename[1]);
$post = 'http://dz.xf.qq.com/ftn.php?v=1&&';
$k = _hash_hmac('sha1', sprintf('%s|%s|%s', $sha1, $_G['timestamp'], $_G['setting']['ftn_site_id']), $_G['setting']['xf_storage_enc_key']);
$parm = array('site_id' => $_G['setting']['ftn_site_id'], 't' => $_G['timestamp'], 'sha1' => $sha1, 'filesize' => $filesize, 'filename' => $filename, 'k' => $k, 'ip' => $_G['clientip']);
return $post . cloud_http_build_query($parm, '', '&&');
}
示例8: build_cache_creditrule
function build_cache_creditrule()
{
$data = array();
$query = DB::query("SELECT * FROM " . DB::table('common_credit_rule'));
while ($rule = DB::fetch($query)) {
if (strtoupper(CHARSET) != 'UTF-8') {
$rule['rulenameuni'] = urlencode(diconv($rule['rulename'], CHARSET, 'UTF-8', true));
} else {
$rule['rulenameuni'] = $rule['rulename'];
}
$data[$rule['action']] = $rule;
}
save_syscache('creditrule', $data);
}
示例9: getpagelink
function getpagelink($city, $page, $updatetype = false)
{
global $_G;
require_once libfile('class/xml');
$goodsxmlfile = MOKUAI_DIR . '/shop/1.0/Data/lashou_' . $city . '.xml';
$goodss = xml2array(file_get_contents($goodsxmlfile));
$goodslist_text = file_get_contents('http://' . $city . '.lashou.com/page' . $page);
$ga0 = explode('<div class="content-list">', $goodslist_text);
$ga1 = explode('<!-- main end -->', $ga0[1]);
$ga2 = explode('<div class="com-img">', $ga1[0]);
foreach ($ga2 as $k => $v) {
$ga3 = explode('.lashou.com/deal/', $v);
$ga4 = explode('.html', $ga3[1]);
if ($ga4[0]) {
$goodss[$ga4[0]]['oldid'] = $ga4[0];
}
}
file_put_contents($goodsxmlfile, diconv(array2xml($goodss, 1), "UTF-8", $_G['charset'] . "//IGNORE"));
return $goodss;
}
示例10: text
public static function text($param)
{
list($data) = $param;
self::_init();
global $_G;
$data['content'] = diconv($data['content'], 'UTF-8');
$isloginkeyword = self::_custom('text', $data['content']);
if (!$_G['wechat']['setting']['wsq_allow']) {
return;
}
$authcode = C::t('#wechat#mobile_wechat_authcode')->fetch_by_code($data['content']);
if (!$authcode || $authcode['status']) {
if ($isloginkeyword) {
wsq::report('loginclick');
self::_show('access', $data['from']);
}
} else {
wsq::report('sendnum');
self::_show('sendnum', $data['from'] . "\t" . $authcode['sid'], 60);
}
}
示例11: variable
function variable($variables = array())
{
global $_G;
$globals = array('cookiepre' => $_G['config']['cookie']['cookiepre'], 'auth' => $_G['cookie']['auth'], 'saltkey' => $_G['cookie']['saltkey'], 'member_uid' => $_G['member']['uid'], 'member_username' => $_G['member']['username'], 'groupid' => $_G['groupid'], 'formhash' => FORMHASH, 'ismoderator' => $_G['forum']['ismoderator'], 'readaccess' => $_G['group']['readaccess']);
if (!empty($_GET['submodule']) == 'checkpost') {
$apifile = 'source/plugin/mobile/api/' . $_GET['version'] . '/sub_checkpost.php';
if (file_exists($apifile)) {
require_once $apifile;
$globals = $globals + mobile_api_sub::getvariable();
}
}
$xml = array('Version' => '2', 'Charset' => strtoupper($_G['charset']), 'Variables' => array_merge($globals, $variables));
if (!empty($_G['messageparam'])) {
$message_result = lang('plugin/mobile', $_G['messageparam'][0], $_G['messageparam'][2]);
if ($message_result == $_G['messageparam'][0]) {
$vars = explode(':', $_G['messageparam'][0]);
if (count($vars) == 2) {
$message_result = lang('plugin/' . $vars[0], $vars[1], $_G['messageparam'][2]);
$_G['messageparam'][0] = $vars[1];
} else {
$message_result = lang('message', $_G['messageparam'][0], $_G['messageparam'][2]);
}
}
$message_result = strip_tags($message_result);
if ($_G['messageparam'][4]) {
$_G['messageparam'][0] = "custom";
}
if ($_G['messageparam'][3]['login'] && !$_G['uid']) {
$_G['messageparam'][0] .= '//' . $_G['messageparam'][3]['login'];
}
$xml['Message'] = array("messageval" => $_G['messageparam'][0], "messagestr" => $message_result);
if ($_GET['mobilemessage']) {
$return = mobile_core::json($xml);
header("HTTP/1.1 301 Moved Permanently");
header("Location:discuz://" . $_G['messageparam'][0] . "//" . rawurlencode(diconv($message_result, $_G['charset'], "utf-8")) . ($return ? "//" . rawurlencode($return) : ''));
exit;
}
}
return $xml;
}
示例12: get_tplaylist_byid
function get_tplaylist_byid($id)
{
$url = "http://api.tudou.com/v6/playlist/video_list?app_key=a3f35cc3746929ab&format=json&pageSize=100&playlistCode=" . $id;
$s = file_get_contents($url);
$result = json_decode($s, true);
$video = $result['results'];
if (empty($result)) {
return false;
}
$result['videoname'] = array();
$result['videolink'] = array();
$result['videoimg'] = array();
$result['videotime'] = array();
foreach ($video as $vk => $vv) {
//http://player.56.com/cpm_MTA4NzEzNDUz.swf
$result['videoname'][$vk] = diconv($vv['title'], "utf-8");
$result['videolink'][$vk] = $vv['outerPlayerUrl'];
$result['videoimg'][$vk] = $vv['picUrl'];
$result['videotime'][$vk] = strtotime($vv['pubDate']);
}
return $result;
}
示例13: updatecache
C::t('common_setting')->update_batch($settings);
updatecache('setting');
}
$locationUrl = ADMINSCRIPT . '?frames=yes&action=cloud&operation=doctor';
cpmsg('cloud_idkeysetting_success', '', 'succeed', array(), '<p class="marginbot"><a href="###" onclick="top.location = \'' . $locationUrl . '\'" class="lightlink">' . cplang('message_redirect') . '</a></p><script type="text/JavaScript">setTimeout("top.location = \'' . $locationUrl . '\'", 3000);</script>');
} elseif ($op == 'apitest') {
$doctorService = Cloud::loadClass('Service_Doctor');
$APIType = intval($_GET['api_type']);
$APIIP = trim($_GET['api_ip']);
$startTime = microtime(true);
$testStatus = $doctorService->testAPI($APIType, $APIIP, $_G['setting']);
$endTime = microtime(true);
$otherTips = '';
if ($APIIP) {
if ($_GET['api_description']) {
$otherTips = diconv(trim($_GET['api_description']), 'UTF-8');
}
} else {
if ($APIType == 1) {
$otherTips = '<a href="javascript:;" onClick="display(\'cloud_tbody_api_test\')">' . $lang['cloud_doctor_api_test_other'] . '</a>';
} elseif ($APIType == 2) {
$otherTips = '<a href="javascript:;" onClick="display(\'cloud_tbody_manyou_test\')">' . $lang['cloud_doctor_manyou_test_other'] . '</a>';
} elseif ($APIType == 3) {
$otherTips = '<a href="javascript:;" onClick="display(\'cloud_tbody_qzone_test\')">' . $lang['cloud_doctor_qzone_test_other'] . '</a>';
}
}
ajaxshowheader();
if ($testStatus) {
printf($lang['cloud_doctor_api_test_success'], $lang['cloud_doctor_result_success'], $APIIP, $endTime - $startTime, $otherTips);
} else {
printf($lang['cloud_doctor_api_test_failure'], $lang['cloud_doctor_result_failure'], $APIIP, $otherTips);
示例14: substr
$outxml .= '<shuffle>' . $musicmsgs['config']['shuffle'] . '</shuffle>' . "\n";
$outxml .= '<repeat>all</repeat>' . "\n";
$outxml .= '<volume>100</volume>';
$outxml .= '<linktarget>_top</linktarget> ' . "\n";
$outxml .= '<backcolor>0x' . substr($musicmsgs['config']['crontabcolor'], -6) . '</backcolor> ' . "\n";
$outxml .= '<frontcolor>0x' . substr($musicmsgs['config']['buttoncolor'], -6) . '</frontcolor>' . "\n";
$outxml .= '<lightcolor>0x' . substr($musicmsgs['config']['fontcolor'], -6) . '</lightcolor>' . "\n";
$outxml .= '<jpgfile>' . $musicmsgs['config']['crontabbj'] . '</jpgfile>' . "\n";
$outxml .= '<callback></callback> ' . "\n";
$outxml .= '</mp3config>' . "\n";
$outxml .= '<trackList>' . "\n";
foreach ($musicmsgs['mp3list'] as $value) {
$outxml .= '<track><annotation>' . $value['mp3name'] . '</annotation><location>' . $value['mp3url'] . '</location><image>' . $value['cdbj'] . '</image></track>' . "\n";
}
$outxml .= '</trackList></playlist>';
$outxml = diconv($outxml, CHARSET, 'UTF-8');
obclean();
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
@header("Content-type: application/xml; charset=utf-8");
echo $outxml;
}
exit;
} else {
$viewuids = $_G['cookie']['viewuids'] ? explode('_', $_G['cookie']['viewuids']) : array();
if (!$_G['setting']['preventrefresh'] || $_G['uid'] && !$space['self'] && !in_array($space['uid'], $viewuids)) {
member_count_update($space['uid'], array('views' => 1));
$viewuids[$space['uid']] = $space['uid'];
dsetcookie('viewuids', implode('_', $viewuids));
}
示例15: setThreadTitle
public function setThreadTitle($title)
{
$this->_threadTitle = baidu_strip_invalid_xml(diconv(trim($title), CHARSET, 'utf-8'));
}