StringHelper::endsWith PHP Méthode

endsWith() public méthode

public endsWith ( string $str ) : boolean
$str string
Résultat boolean
    public function endsWith($str)
    {
        $sLen = mb_strlen($str);
        return mb_substr($this->value, $this->length - $sLen) == $str;
    }

Usage Example

Exemple #1
0
 /**
  * Prefix to apply to properties loaded using <code>file</code>.
  * A "." is appended to the prefix if not specified.
  * @param string $prefix prefix string
  * @return void
  * @since 2.0
  */
 function setPrefix($prefix)
 {
     $this->prefix = $prefix;
     if (!StringHelper::endsWith(".", $prefix)) {
         $this->prefix .= ".";
     }
 }
All Usage Examples Of StringHelper::endsWith