endsWith() public method

Returns true if the string ends with $substring, false otherwise. By default, the comparison is case-sensitive, but can be made insensitive by setting $caseSensitive to false.
public endsWith ( string $substring, boolean $caseSensitive = true ) : boolean
$substring string The substring to look for
$caseSensitive boolean Whether or not to enforce case-sensitivity
return boolean Whether or not $str ends with $substring
示例#1
2
 private function isAlbum()
 {
     if (!empty($this->parsedUrl['path'])) {
         // TODO: как правильно вызывать Stringy чтобы не создавать 100 экземпляров внутри кода?
         $stringy = new Stringy();
         $result = $stringy->endsWith(Urls::ALBUM);
         if ($result === true) {
             return true;
         }
     }
     return false;
 }