當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Filter::isHostname方法代碼示例

本文整理匯總了PHP中Zend_Filter::isHostname方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Filter::isHostname方法的具體用法?PHP Zend_Filter::isHostname怎麽用?PHP Zend_Filter::isHostname使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Filter的用法示例。


在下文中一共展示了Zend_Filter::isHostname方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testHostname

 /**
  * Returns value if it is a valid hostname, FALSE otherwise.
  * Depending upon the value of $allow, Internet domain names, IP
  * addresses, and/or local network names are considered valid.
  * The default is HOST_ALLOW_ALL, which considers all of the
  * above to be valid.
  *
  * @param mixed $key
  * @param integer $allow bitfield for HOST_ALLOW_DNS, HOST_ALLOW_IP, HOST_ALLOW_LOCAL
  * @return mixed
  */
 public function testHostname($key, $allow = Zend_Filter::HOST_ALLOW_ALL)
 {
     if (!$this->keyExists($key)) {
         return false;
     }
     if (Zend_Filter::isHostname($this->_source[$key], $allow)) {
         return $this->_source[$key];
     }
     return FALSE;
 }
開發者ID:fferriere,項目名稱:web,代碼行數:21,代碼來源:Input.php

示例2: validateHost

 /**
  * Returns true if and only if the host string passes validation. If no host is passed,
  * then the host contained in the instance variable is used.
  *
  * @param string $host
  * @return boolean
  * @uses Zend_Filter
  */
 public function validateHost($host = null)
 {
     if ($host === null) {
         $host = $this->_host;
     }
     /**
      * If the host is empty, then it is considered invalid
      */
     if (strlen($host) == 0) {
         return false;
     }
     /**
      * Check the host against the allowed values; delegated to Zend_Filter. As a feature, this only
      * validates Internet domain names and local network names; IP addresses are considered invalid.
      *
      * @link http://www.faqs.org/rfcs/rfc2396.html
      */
     $allow = Zend_Filter::HOST_ALLOW_DNS | Zend_Filter::HOST_ALLOW_LOCAL;
     return Zend_Filter::isHostname($host, $allow) !== FALSE;
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:28,代碼來源:Http.php

示例3: isHostname

 /**
  * Returns value if it is a valid hostname, FALSE otherwise.
  * Depending upon the value of $allow, Internet domain names, IP
  * addresses, and/or local network names are considered valid.
  * The default is HOST_ALLOW_ALL, which considers all of the
  * above to be valid.
  *
  * @param mixed $key
  * @param integer $allow bitfield for HOST_ALLOW_DNS, HOST_ALLOW_IP, HOST_ALLOW_LOCAL
  * @throws Zend_Filter_Exception
  * @return mixed
  */
 public function isHostname($key, $allow = Zend_Filter::HOST_ALLOW_ALL)
 {
     return Zend_Filter::isHostname($this->_source[$key], $allow);
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:16,代碼來源:InputFilter.php

示例4: validateHost

 /**
  * Returns true if and only if the host string passes validation. If no host is passed,
  * then the host contained in the instance variable is used.
  *
  * @param string $host
  * @return boolean
  * @uses Zend_Filter
  */
 public function validateHost($host = null)
 {
     if ($host === null) {
         $host = $this->_host;
     }
     /**
      * If the host is empty, then it is considered invalid
      */
     if (strlen($host) == 0) {
         return false;
     }
     /**
      * Check the host against the allowed values; delegated to Zend_Filter.
      */
     return Zend_Filter::isHostname($host) !== FALSE;
 }
開發者ID:BackupTheBerlios,項目名稱:openpublisher-svn,代碼行數:24,代碼來源:Http.php

示例5: testHostname

 /**
  * Returns value if it is a valid hostname, FALSE otherwise.
  * Depending upon the value of $allow, Internet domain names, IP
  * addresses, and/or local network names are considered valid.
  * The default is HOST_ALLOW_ALL, which considers all of the
  * above to be valid.
  *
  * @param mixed $key
  * @param integer $allow bitfield for HOST_ALLOW_DNS, HOST_ALLOW_IP, HOST_ALLOW_LOCAL
  * @return mixed
  */
 public function testHostname($key = null, $allow = Zend_Filter::HOST_ALLOW_ALL)
 {
     if (!($value = $this->keyExists($key))) {
         return false;
     }
     if (Zend_Filter::isHostname($value, $allow)) {
         return $value;
     }
     return FALSE;
 }
開發者ID:jorgenils,項目名稱:zend-framework,代碼行數:21,代碼來源:Input.php


注:本文中的Zend_Filter::isHostname方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。