当前位置: 首页>>代码示例>>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;未经允许,请勿转载。