Neos\Flow\I18n\Utility::stringEndsWith PHP 메소드

stringEndsWith() 공개 정적인 메소드

Checks if $haystack string ends with $needle string.
public static stringEndsWith ( string $haystack, string $needle ) : boolean
$haystack string
$needle string
리턴 boolean TRUE if $haystack ends with $needle
    public static function stringEndsWith($haystack, $needle)
    {
        if (substr($haystack, -strlen($needle)) === $needle) {
            return true;
        }
        return false;
    }

Usage Example

 /**
  * @test
  * @dataProvider sampleHaystackStringsAndNeedleStrings
  */
 public function stringIsFoundAtEndingOfAnotherString($haystack, $needle, $comparison)
 {
     $expectedResult = $comparison === 'ending' || $comparison === 'both' ? true : false;
     $result = I18n\Utility::stringEndsWith($haystack, $needle);
     $this->assertEquals($expectedResult, $result);
 }
All Usage Examples Of Neos\Flow\I18n\Utility::stringEndsWith