當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。