本文整理汇总了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) {