当前位置: 首页>>代码示例>>PHP>>正文


PHP Valid::email_domain方法代码示例

本文整理汇总了PHP中Valid::email_domain方法的典型用法代码示例。如果您正苦于以下问题:PHP Valid::email_domain方法的具体用法?PHP Valid::email_domain怎么用?PHP Valid::email_domain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Valid的用法示例。


在下文中一共展示了Valid::email_domain方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: email

 /**
  * Check an email address for correct format.
  *
  * @param   string   email address
  * @param   boolean  strict RFC compatibility and valid domain with MX
  * @return  boolean
  */
 public static function email($email, $strict = FALSE)
 {
     //strict validation
     if ($strict === TRUE) {
         //check the RFC compatibility and MX
         return parent::email($email, TRUE) ? Valid::email_domain($email) : FALSE;
     } else {
         return parent::email($email);
     }
 }
开发者ID:Wildboard,项目名称:WbWebApp,代码行数:17,代码来源:valid.php

示例2: email

 /**
  * Check an email address for correct format.
  *
  * @param   string   email address
  * @param   boolean  valid domain with MX and not disposable email
  * @return  boolean
  */
 public static function email($email, $strict = FALSE)
 {
     //get the email to check up, clean it
     $email = filter_var($email, FILTER_SANITIZE_STRING);
     // 1 - check valid email format using RFC 822
     if (filter_var($email, FILTER_VALIDATE_EMAIL) === FALSE) {
         return FALSE;
     }
     //strict validation, MX domain and valid domain not disposable
     if ($strict === TRUE) {
         return Valid::email_domain($email);
     }
     // wow actually a real email! congrats ;)
     return TRUE;
 }
开发者ID:JeffPedro,项目名称:project-garage-sale,代码行数:22,代码来源:valid.php

示例3: test_email_domain

 /**
  * Tests Valid::email_domain()
  *
  * Validate the domain of an email address by checking if the domain has a
  * valid MX record.
  *
  * Test skips on windows
  *
  * @test
  * @dataProvider provider_email_domain
  * @param string  $email   Email domain to check
  * @param boolean $correct Is it correct?
  */
 public function test_email_domain($email, $correct)
 {
     if (!$this->hasInternet()) {
         $this->markTestSkipped('An internet connection is required for this test');
     }
     if (!Kohana::$is_windows or version_compare(PHP_VERSION, '5.3.0', '>=')) {
         $this->assertSame($correct, Valid::email_domain($email));
     } else {
         $this->markTestSkipped('checkdnsrr() was not added on windows until PHP 5.3');
     }
 }
开发者ID:reznikds,项目名称:Reznik,代码行数:24,代码来源:ValidTest.php


注:本文中的Valid::email_domain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。