本文整理汇总了PHP中Mail_RFC822::_substr_count方法的典型用法代码示例。如果您正苦于以下问题:PHP Mail_RFC822::_substr_count方法的具体用法?PHP Mail_RFC822::_substr_count怎么用?PHP Mail_RFC822::_substr_count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mail_RFC822
的用法示例。
在下文中一共展示了Mail_RFC822::_substr_count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _hasUnclosedBrackets
/**
* Checks if a string has an unclosed brackets or not. IMPORTANT:
* This function handles both angle brackets and square brackets;
*
* @access private
* @param string $string The string to check.
* @param string $chars The characters to check for.
* @return boolean True if there are unclosed brackets inside the string, false otherwise.
*/
function _hasUnclosedBrackets($string, $chars)
{
$num_angle_start = Mail_RFC822::_substr_count($string, $chars[0]);
$num_angle_end = Mail_RFC822::_substr_count($string, $chars[1]);
$this->_hasUnclosedBracketsSub($string, $num_angle_start, $chars[0]);
$this->_hasUnclosedBracketsSub($string, $num_angle_end, $chars[1]);
if ($num_angle_start < $num_angle_end) {
$this->error = 'Invalid address spec. Unmatched quote or bracket (' . $chars . ')';
return false;
} else {
return ($num_angle_start > $num_angle_end);
}
}