本文整理匯總了PHP中CString::normSpacing方法的典型用法代碼示例。如果您正苦於以下問題:PHP CString::normSpacing方法的具體用法?PHP CString::normSpacing怎麽用?PHP CString::normSpacing使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CString
的用法示例。
在下文中一共展示了CString::normSpacing方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: makeEnName
protected static function makeEnName($name)
{
$name = CString::replace($name, "/", ", ");
$name = CString::replace($name, "_", " ");
$name = CRegex::replace($name, "/[^A-Z0-9\\-+,]/i", " ");
$name = CString::normSpacing($name);
return $name;
}
示例2: filter
//.........這裏部分代碼省略.........
}
if (isset($this->m_floatClampingMin) && $value < $this->m_floatClampingMin) {
$value = $this->m_floatClampingMin;
}
if (isset($this->m_floatClampingMax) && $value > $this->m_floatClampingMax) {
$value = $this->m_floatClampingMax;
}
return $value;
}
if ($this->m_expectedType == self::CSTRING) {
$value = $inputString;
if (!CString::isValid($value)) {
$success = false;
return $this->m_defaultValue;
}
if (!$this->m_keepAbnormalNewlines) {
$value = CString::normNewlines($value);
}
if (!$this->m_keepNonPrintable) {
if (!$this->m_keepTabsAndNewlines) {
$value = CRegex::remove($value, "/[\\x00-\\x1F\\x7F-\\xFF]/");
} else {
$value = CRegex::remove($value, "/[\\x00-\\x1F\\x7F-\\xFF](?<![\\x09\\x0A\\x0D])/");
}
} else {
if (!$this->m_keepTabsAndNewlines) {
$value = CRegex::remove($value, "/[\\x09\\x0A\\x0D]/");
}
}
if (!$this->m_keepSideSpacing) {
$value = CString::trim($value);
}
if (!$this->m_keepExtraSpacing) {
$value = CString::normSpacing($value);
}
return $value;
}
if ($this->m_expectedType == self::CUSTRING) {
$value = $inputString;
if (!CUString::isValid($value)) {
$success = false;
return $this->m_defaultValue;
}
if (!$this->m_keepAbnormalNewlines) {
$value = CUString::normNewlines($value);
}
if (!$this->m_keepNonPrintable) {
if (!$this->m_keepTabsAndNewlines) {
$value = CRegex::remove($value, "/\\p{C}|\\p{Zl}|\\p{Zp}/u");
} else {
$value = CRegex::remove($value, "/\\p{C}(?<!\\x{0009}|\\x{000A}|\\x{000D})/u");
}
} else {
if (!$this->m_keepTabsAndNewlines) {
$value = CRegex::remove($value, "/\\x{0009}|\\x{000A}|\\x{000D}|\\p{Zl}|\\p{Zp}/u");
}
}
if (!$this->m_keepSideSpacing) {
$value = CUString::trim($value);
}
if (!$this->m_keepExtraSpacing) {
$value = CUString::normSpacing($value);
}
return $value;
}
if ($this->m_expectedType == self::EMAIL) {