/** * Test that startsWith() returns true if the start of the string matches the needle. */ public function testStartsWith() { $this->assertTrue(String::startsWith($this->string, 'Titon')); $this->assertFalse(String::startsWith($this->string, 'Titan')); // case-insensitive $this->assertTrue(String::startsWith($this->string, 'TITON', false)); $this->assertFalse(String::startsWith($this->string, 'TITAN', false)); }
function str_starts_with($string, $needle, $strict = true) { return String::startsWith($string, $needle, $strict); }