本文整理匯總了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;
}
}