code: public function endsWith($pattern)
      {
          return (substr($this->string, strlen($pattern) * -1) == $pattern) ? true : false;
      }
docs: Returns true if the string ends with $pattern.
  
  @param  string $pattern
  @return boolean