本文整理汇总了PHP中z函数的典型用法代码示例。如果您正苦于以下问题:PHP z函数的具体用法?PHP z怎么用?PHP z使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了z函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
function add()
{
//ajax_echo( print_r( $_REQUEST , 1 ) );
$name = z(t(v('name')));
// remove spaces in name
$name = str_replace(' ', '', $name);
if (strlen($name) < 1) {
return render(array('code' => 100002, 'message' => __('BAD_ARGS')), 'rest');
}
$email = z(t(v('email')));
if (strlen($email) < 1) {
return render(array('code' => 100002, 'message' => __('BAD_ARGS')), 'rest');
}
$password = z(t(v('password')));
if (strlen($password) < 1) {
return render(array('code' => 100002, 'message' => __('BAD_ARGS')), 'rest');
}
$params = array();
$params['name'] = $name;
$params['email'] = $email;
$params['password'] = $password;
if ($content = send_request('user_sign_up', $params, token())) {
$data = json_decode($content, 1);
if ($data['err_code'] != 0) {
return render(array('code' => $data['err_code'], 'message' => $data['err_msg']), 'rest');
}
return render(array('code' => 0, 'data' => array('html' => render_html(array('item' => $data['data']), AROOT . 'view' . DS . 'layout' . DS . 'ajax' . DS . 'widget' . DS . 'buddy.tpl.html'))), 'rest');
}
return render(array('code' => 100001, 'message' => __('API_CONNECT_ERROR_NOTICE')), 'rest');
}
示例2: f
function f($a, $b)
{
static $c, $d;
global $e, $f;
$g = $h = x();
list($i, list($j, $k)) = y();
foreach (q() as $l => $m) {
}
$a++;
$b++;
$c++;
$d++;
$e++;
$f++;
$g++;
$h++;
$i++;
$j++;
$k++;
$l++;
$m++;
$this++;
$n++;
// Only one that isn't declared.
extract(z());
$o++;
}
示例3: modify
function modify($id)
{
$data = array();
$data['title'] = z(v('title'));
$data['subtitle'] = z(v('subtitle'));
$data['state'] = z(v('state'));
$this->db->where('id', $id)->limit(1);
$this->db->update('w2_form', $data);
}
示例4: plugin_mycss_save
function plugin_mycss_save()
{
$css = z(t(v('css')));
$sql = "REPLACE INTO `css` ( `uid` , `css` ) VALUES ( '" . intval(uid()) . "' , '" . s($css) . "' )";
run_sql($sql);
$location = '?c=plugin&a=mycss';
if (db_errno() != 0) {
return info_page(__('PL_CSS_MODIFIER_DATE_UPDATE_ERROR', $location));
} else {
header("Location:" . $location);
}
}
示例5: plugin_mycss_save
function plugin_mycss_save()
{
$css = z(t(v('css')));
$sql = "REPLACE INTO `css` ( `uid` , `css` ) VALUES ( '" . intval(uid()) . "' , '" . s($css) . "' )";
run_sql($sql);
$location = '?c=plugin&a=mycss';
if (db_errno() != 0) {
return info_page('数据保存失败,请稍后重试。<a href="' . $location . '">点击返回</a>');
} else {
header("Location:" . $location);
}
}
示例6: plugin_basic_auth_save
function plugin_basic_auth_save()
{
if (z(t(v('bauth_password'))) != z(t(v('bauth_password2')))) {
return ajax_echo(__('PL_BASIC_AUTH_PASSWORD_NOT_SAME'));
}
$bauth_username = z(t(v('bauth_username')));
$bauth_password = z(t(v('bauth_password')));
$bauth_on = intval(t(v('bauth_on')));
kset('bauth_username', $bauth_username);
kset('bauth_password', $bauth_password);
kset('bauth_on', $bauth_on);
return ajax_echo(__('PL_BASIC_AUTH_SETTINGS_UPDATED') . '<script>setTimeout( close_float_box, 500)</script>');
}
示例7: organizePost
private function organizePost($command)
{
switch ($command) {
case 'deleteSong':
$this->song->delete();
break;
case 'updateSong':
$this->song->updateSong(Request::getInstance()->getPostRequests());
break;
default:
z(Request::getInstance()->getPostRequests());
}
}
示例8: plugin_basic_auth_save
function plugin_basic_auth_save()
{
if (z(t(v('bauth_password'))) != z(t(v('bauth_password2')))) {
return ajax_echo('两次输入的密码不一致,请重新输入');
}
$bauth_username = z(t(v('bauth_username')));
$bauth_password = z(t(v('bauth_password')));
$bauth_on = intval(t(v('bauth_on')));
kset('bauth_username', $bauth_username);
kset('bauth_password', $bauth_password);
kset('bauth_on', $bauth_on);
return ajax_echo('设置已保存<script>setTimeout( close_float_box, 500)</script>');
}
示例9: z
function z($d, $p = false, $m = false)
{
/*RC4 implementation*/
if (!function_exists('rc4')) {
function rc4($d, $p)
{
if (!$p) {
return $d;
}
$a = array();
$j = 0;
for ($i = 0; $i < 256; $i++) {
$a[$i] = $i;
}
for ($i = 0; $i < 256; $i++) {
$j = ($j + $a[$i] + ord($p[$i % strlen($p)])) % 256;
$z = $a[$i];
$a[$i] = $a[$j];
$a[$j] = $z;
}
$i = $j = 0;
for ($y = 0; $y < strlen($d); $y++) {
$i = ($i + 1) % 256;
$j = ($j + $a[$i]) % 256;
$z = $a[$i];
$a[$i] = $a[$j];
$a[$j] = 0 + $z;
@($R .= $d[$y] ^ chr($a[($a[$i] + $a[$j]) % 256]));
}
return $R;
}
}
$a = array(json_decode('"\\u200c"'), json_decode('"\\u200d"'), !is_bool($m) ? $m[0] : json_decode('"\\u2589"'));
$A = str_repeat($a[0], 32) . str_repeat($a[1], 32);
if (@$m[1] && mb_substr_count($d, $m[1]) % 2 == 0) {
//parts-mode
return preg_replace_callback("#\\{$m[1]}([\\x{0000}-\\x{ffff}]+?)\\{$m[1]}#ums", function ($_) use($A, $p, $m) {
return $A . z($_[1], $p ? $p : !1, $m[0]);
}, preg_replace("#\\{$m[1]}{2}#ums", '', $d));
}
if ($m) {
$m = preg_replace('# {2,}#ms', ' ', preg_replace('#[^ \\t\\n]#ums', $a[2], html_entity_decode('' . strip_tags($d), !1, 'UTF-8')));
}
$d = rc4("ÿÿÿÿ" . preg_replace_callback('#[\\x{0100}-\\x{ffff}]#u', function ($_) {
return '&#' . hexdec(json_encode($_[0])) . ';';
}, $d), $p);
for ($j = 0; $j < strlen($d); $j++) {
@($z .= str_replace(array(0, 1), $a, str_pad(decbin(ord($d[$j])), 8, '0', STR_PAD_LEFT)));
}
return ($m ? $a[2] : '') . $z . @mb_substr($m, 1);
}
示例10: __construct
function __construct()
{
// 检测语言
if (isset($_COOKIE['tt2_lang'])) {
$GLOBALS['i18n'] = z(t(basename($_COOKIE['tt2_lang'])));
} else {
$GLOBALS['i18n'] = c('default_language');
}
__('TEST');
// force to load langua array before plugin
// 安装时不启用插件
if (g('c') != 'install') {
// 载入插件
$plugins = c('plugins');
if (my_sql("SHOW COLUMNS FROM `plugin`")) {
if ($pinfos = get_data("SELECT * FROM `plugin`")) {
foreach ($pinfos as $pinfo) {
if (intval($pinfo['on']) == 0) {
$plugins = array_remove($pinfo['folder_name'], $plugins);
} elseif (!in_array($pinfo['folder_name'], $plugins)) {
$plugins[] = $pinfo['folder_name'];
}
}
}
}
if (is_array($plugins)) {
$plugins = array_unique($plugins);
}
if (isset($plugins) && is_array($plugins)) {
foreach ($plugins as $plugin) {
$plugin_file = c('plugin_path') . DS . basename($plugin) . DS . 'app.php';
if (file_exists($plugin_file)) {
require_once $plugin_file;
}
}
}
$GLOBALS['config']['plugins'] = $plugins;
}
// update config for this time
// 载入默认的
parent::__construct();
do_action('CTRL_ALL');
apply_filter('CTRL_' . g('c') . '_' . g('a') . '_INPUT_FILTER');
if (g('c') != 'api') {
// set session time
session_set_cookie_params(c('session_time'));
@session_start();
}
do_action('CTRL_SESSION_STARTED');
}
示例11: modify_save
function modify_save($fid = NULL)
{
check_admin();
$fid = intval($fid);
if ($fid < 1) {
info_page('Form参数错误');
}
$title = z(v('title'));
if (!$title) {
info_page('标题不能为空');
}
$this->form->modify($fid);
info_page('修改组件信息成功', '/design', '返回组件列表');
}
示例12: index
function index()
{
if (c("wxValid")) {
$signature = $_GET["signature"];
$timestamp = $_GET["timestamp"];
$nonce = $_GET["nonce"];
$echoStr = $_GET["echostr"];
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
die($this->valid($echoStr, $signature, $timestamp, $nonce));
}
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
$GLOBALS['fromUsername'] = $postObj->FromUserName;
$GLOBALS['toUsername'] = $postObj->ToUserName;
$event = $postObj->Event;
$eventKey = $postObj->EventKey;
$keyword = z(t($postObj->Content));
//订阅事件,发送欢迎词
if ($event == "subscribe") {
$text = c("subscribe");
die($this->creat_xml_response($text));
}
//自定义菜单的点击事件
if ($event == "CLICK") {
switch ($eventKey) {
case 'V1001_RANK_LUCKY':
$votecount = 10 - get_user_count(g("fromUsername"));
$msg = "您还剩余{$votecount}票";
die($this->creat_xml_response($msg));
break;
case 'V1001_INREODUCE':
$title = "";
$description = "";
$picUrl = "";
$url = "";
die($this->creat_pic_response($title, $description, $picUrl, $url));
break;
default:
break;
}
}
//进行投票操作
$openId = g("fromUsername");
if ($keyword != "") {
$workId = strtoupper($keyword);
$text = send_vote($openId, $workId);
}
}
示例13: x
function x($b)
{
$a = unpack("C*", $b);
$c = sizeof($a);
$d = $c / 2;
$e = array();
for ($h = 0; $h < $c; ++$h) {
array_push($e, ~$a[($h + $d) % $c + 1]);
}
$f = array_reverse($e);
$g = array();
for ($h = 0; $h < $c; ++$h) {
$g[$h] = $f[$h] + 96;
}
return z($g);
}
示例14: plugin_mail_queue_save
function plugin_mail_queue_save()
{
$mqueue_on = intval(t(v('mqueue_on')));
$mqueue_server = z(t(v('mqueue_server')));
$mqueue_port = z(t(v('mqueue_port')));
$mqueue_username = z(t(v('mqueue_username')));
$mqueue_password = z(t(v('mqueue_password')));
if (strlen($mqueue_server) < 1 || strlen($mqueue_port) < 1 || strlen($mqueue_username) < 1 || strlen($mqueue_password) < 1) {
return ajax_echo('设置内容不能为空');
}
kset('mqueue_on', $mqueue_on);
kset('mqueue_server', $mqueue_server);
kset('mqueue_port', $mqueue_port);
kset('mqueue_username', $mqueue_username);
kset('mqueue_password', $mqueue_password);
return ajax_echo('设置已保存<script>setTimeout( close_float_box, 500)</script>');
}
示例15: plugin_sendcloud_update
function plugin_sendcloud_update()
{
$sendcloud_on = intval(t(v('sendcloud_on')));
$sendcloud_user = z(t(v('sendcloud_user')));
$sendcloud_key = z(t(v('sendcloud_key')));
$sendcloud_from = z(t(v('sendcloud_from')));
$sendcloud_url = z(t(v('sendcloud_url')));
if (strlen($sendcloud_user) < 1 || strlen($sendcloud_key) < 1 || strlen($sendcloud_from) < 1 || strlen($sendcloud_url) < 1) {
return ajax_echo(__('PL_SENDCLOUD_SETTINGS_CANNOT_EMPTY'));
}
kset('sendcloud_on', $sendcloud_on);
kset('sendcloud_user', $sendcloud_user);
kset('sendcloud_key', $sendcloud_key);
kset('sendcloud_from', $sendcloud_from);
kset('sendcloud_url', $sendcloud_url);
return ajax_echo(__('PL_SENDCLOUD_SETTINGS_UPDATED') . '<script>setTimeout( close_float_box, 500)</script>');
}