Piwik\Common::stringEndsWith PHP Méthode

stringEndsWith() public static méthode

public static stringEndsWith ( $haystack, $needle )
    public static function stringEndsWith($haystack, $needle)
    {
        if ('' === $needle) {
            return true;
        }
        $lastCharacters = substr($haystack, -strlen($needle));
        return $lastCharacters === $needle;
    }

Usage Example

Exemple #1
0
 public function __toString()
 {
     $sql = $this->sql;
     if (!Common::stringEndsWith($sql, ';')) {
         $sql .= ';';
     }
     return $sql;
 }
All Usage Examples Of Piwik\Common::stringEndsWith