本文整理汇总了PHP中S::escapeStr方法的典型用法代码示例。如果您正苦于以下问题:PHP S::escapeStr方法的具体用法?PHP S::escapeStr怎么用?PHP S::escapeStr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类S
的用法示例。
在下文中一共展示了S::escapeStr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: escapeChar
/**
* 通用多类型转换
* @param $mixed
* @param $isint
* @param $istrim
* @return mixture
*/
function escapeChar($mixed, $isint = false, $istrim = false)
{
if (is_array($mixed)) {
foreach ($mixed as $key => $value) {
$mixed[$key] = S::escapeChar($value, $isint, $istrim);
}
} elseif ($isint) {
$mixed = (int) $mixed;
} elseif (!is_numeric($mixed) && ($istrim ? $mixed = trim($mixed) : $mixed) && $mixed) {
$mixed = S::escapeStr($mixed);
}
return $mixed;
}
示例2: PrintApp
}
$creategroup && ($creategroup = "<ul class=\"list_A list_120 cc\">{$creategroup}</ul>");
require_once PrintApp('admin');
} else {
S::gp(array('creditset', 'creditlog', 'weibophoto', 'weibopost', 'weibourl', 'weibotip', 'weibo_hottopicdays', 'weibo_hotcommentdays', 'weibo_hotfansdays', 'weibo_hottransmitdays'), 'GP');
S::gp(array('groups'), 'GP', 2);
$updatecache = false;
$config['weibophoto'] = $weibophoto ? 1 : 0;
$config['weibopost'] = $weibopost ? 1 : 0;
$config['weibourl'] = $weibourl ? 1 : 0;
$config['weibo_hottopicdays'] = $weibo_hottopicdays ? int($weibo_hottopicdays) : 7;
$config['weibo_hotcommentdays'] = $weibo_hotcommentdays ? intval($weibo_hotcommentdays) : 1;
$config['weibo_hottransmitdays'] = $weibo_hottransmitdays ? intval($weibo_hottransmitdays) : 1;
$config['weibo_hotfansdays'] = $weibo_hotfansdays ? intval($weibo_hotfansdays) : 1;
$config['weibo_creditset'] = '';
$config['weibotip'] = S::escapeStr($weibotip);
$config['weibo_groups'] = is_array($groups) ? ',' . implode(',', $groups) . ',' : '';
if (is_array($creditset) && !empty($creditset)) {
foreach ($creditset as $key => $value) {
foreach ($value as $k => $v) {
$creditset[$key][$k] = round($v, $k == 'rvrc' ? 1 : 0);
}
}
$config['weibo_creditset'] = addslashes(serialize($creditset));
}
is_array($creditlog) && !empty($creditlog) && ($config['weibo_creditlog'] = addslashes(serialize($creditlog)));
foreach ($config as $key => $value) {
if (${'o_' . $key} != $value) {
$db->pw_update('SELECT hk_name FROM pw_hack WHERE hk_name=' . S::sqlEscape("o_{$key}"), 'UPDATE pw_hack SET ' . S::sqlSingle(array('hk_value' => $value, 'vtype' => 'string')) . ' WHERE hk_name=' . S::sqlEscape("o_{$key}"), 'INSERT INTO pw_hack SET ' . S::sqlSingle(array('hk_name' => "o_{$key}", 'vtype' => 'string', 'hk_value' => $value)));
$updatecache = true;
}