コード例 #1
0
ファイル: test-str.php プロジェクト: iCaspar/WPDC_Core
 function test_ends_with()
 {
     $this->assertTrue(Str::ends_with('wpdc', 'dc'));
     $this->assertTrue(wpdevsclub_ends_with('wpdc', 'wpdc'));
     $this->assertTrue(Str::ends_with('wpdc', array('dc')));
     $this->assertFalse(Str::ends_with('wpdc', 'pd'));
     $this->assertFalse(wpdevsclub_ends_with('wpdc', array('wpd')));
     $this->assertFalse(Str::ends_with('wpdc', ''));
     $this->assertFalse(Str::ends_with('7', ' 7'));
 }
コード例 #2
0
ファイル: str-helpers.php プロジェクト: iCaspar/WPDC_Core
 /**
  * Determine if a given string ends with a given substring.
  *
  * @param  string $haystack
  * @param  string|array $needles
  * @return bool
  */
 function wpdevsclub_ends_with($haystack, $needles)
 {
     return Str::ends_with($haystack, $needles);
 }