本文整理汇总了PHP中string_normalize函数的典型用法代码示例。如果您正苦于以下问题:PHP string_normalize函数的具体用法?PHP string_normalize怎么用?PHP string_normalize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了string_normalize函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: prepare_realname
private function prepare_realname($p_user_info, $p_username)
{
switch ($this->_mail_preferred_realname) {
case 'email_address':
$t_realname = $p_user_info['email'];
break;
case 'email_no_domain':
if (preg_match(email_regex_simple(), $p_user_info['email'], $t_check)) {
$t_local = $t_check[1];
$t_domain = $t_check[2];
$t_realname = $t_local;
}
break;
case 'from_ldap':
$t_realname = ldap_realname_from_username($p_username);
break;
case 'full_from':
$t_realname = str_replace(array('<', '>'), array('(', ')'), $p_user_info['From']);
break;
case 'name':
default:
$t_realname = $p_user_info['name'];
}
$t_realname = string_normalize($t_realname);
if (utf8_strlen($t_realname) > DB_FIELD_SIZE_REALNAME) {
$t_realname = utf8_substr($t_realname, 0, DB_FIELD_SIZE_REALNAME);
}
if (user_is_realname_valid($t_realname) && user_is_realname_unique($p_username, $t_realname)) {
return $t_realname;
}
return FALSE;
}
开发者ID:JeromyK,项目名称:EmailReporting,代码行数:32,代码来源:mail_api.php
示例2: email_append_domain
$t_redirect = 'account_page.php';
$t_email_updated = false;
$t_password_updated = false;
$t_realname_updated = false;
/** @todo Listing what fields were updated is not standard behaviour of MantisBT - it also complicates the code. */
if (OFF == config_get('use_ldap_email')) {
$f_email = email_append_domain($f_email);
email_ensure_valid($f_email);
email_ensure_not_disposable($f_email);
if ($f_email != user_get_email($t_user_id)) {
user_set_email($t_user_id, $f_email);
$t_email_updated = true;
}
}
# strip extra spaces from real name
$t_realname = string_normalize($f_realname);
if ($t_realname != user_get_field($t_user_id, 'realname')) {
# checks for problems with realnames
$t_username = user_get_field($t_user_id, 'username');
user_ensure_realname_unique($t_username, $t_realname);
user_set_realname($t_user_id, $t_realname);
$t_realname_updated = true;
}
# Update password if the two match and are not empty
if (!is_blank($f_password)) {
if ($f_password != $f_password_confirm) {
trigger_error(ERROR_USER_CREATE_PASSWORD_MISMATCH, ERROR);
} else {
if (!auth_does_password_match($t_user_id, $f_password)) {
user_set_password($t_user_id, $f_password);
$t_password_updated = true;
开发者ID:kaos,项目名称:mantisbt,代码行数:31,代码来源:account_update.php
示例3: url_title
function url_title($str, $separator = 'dash')
{
if ($separator == 'dash') {
$search = '_';
$replace = '-';
} else {
$search = '-';
$replace = '_';
}
$str = string_normalize($str);
$trans = array($search => $replace, "\\s+" => $replace, "[^\\.a-z0-9" . $replace . "]" => '', $replace . "+" => $replace, $replace . "\$" => '', "^" . $replace => '');
$str = strip_tags(strtolower($str));
foreach ($trans as $key => $val) {
$str = preg_replace("#" . $key . "#", $val, $str);
}
return trim(stripslashes($str));
}
开发者ID:rexcarnation,项目名称:XtraUpload,代码行数:17,代码来源:url_helper.php
注:本文中的string_normalize函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论