本文整理汇总了PHP中Strings::email方法的典型用法代码示例。如果您正苦于以下问题:PHP Strings::email方法的具体用法?PHP Strings::email怎么用?PHP Strings::email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Strings
的用法示例。
在下文中一共展示了Strings::email方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
*
* Checks for valid parameters, and initializes proper options.
*
* @param string $enc_from character set of files (present)
* @param string $enc_to output character set
* @param integer $comp_level
* @param array $incpath elements of include path
*
* @access public
*/
public function __construct(&$enc_from = null, &$enc_to = null, &$comp_level = null, &$email = null, &$incPath = null)
{
if (is_null($incPath)) {
$this->_incPath = array(ROOT, Path::join(ROOT, 'inc'));
} else {
$this->_incPath = $incPath;
}
if (!is_null($email) && Strings::email($email)) {
$this->_email = $email;
}
if (is_null($comp_level)) {
$comp_level = self::COMP_LEVEL;
}
if (is_null($enc_from)) {
$enc_from = self::ENC_FROM;
}
if (is_null($enc_to)) {
$enc_to = self::ENC_TO;
}
if (defined('DEBUG') && DEBUG) {
$this->_debug = true;
}
$ob_start_opts = array();
if ($comp_level > 0) {
$comp = $this->_initCompress($comp_level);
if ($comp !== false) {
$ob_start_opts[] = $comp;
}
}
if ($enc_from !== $enc_to) {
$enc = $this->_initEncoding($enc_from, $enc_to);
if ($enc !== false) {
$ob_start_opts[] = $enc;
}
}
if (count($ob_start_opts) > 0) {
ob_start($ob_start_opts);
$this->_initialized = true;
} else {
$this->_initialized = false;
}
$this->_initPhpSettings();
}
示例2: set_author_mail
/**
* Checks for correctness of email address
*
* @param string $data author's email address
*
* @return boolean
* @throws CESyntaxError if incorrect type (@see $this->isType())
*
* @access protected
*/
protected function set_author_mail($data)
{
if (is_null($data)) {
unset($this->author_mail);
return true;
}
$this->isType('author_mail', $data);
$data = trim($data);
if ('' != $data && !Strings::email($data)) {
$this->errorSet('Incorrect email address.');
return false;
} else {
$this->properties['author_mail'][0] = $data;
return true;
}
}