@@ 439-448 (lines=10) @@ | ||
436 | * |
|
437 | * @return boolean |
|
438 | */ |
|
439 | public function startsWith($input, $expected) |
|
440 | { |
|
441 | $length = strlen($expected); |
|
442 | ||
443 | if ($length === 0) { |
|
444 | return true; |
|
445 | } |
|
446 | ||
447 | return (strcasecmp(substr($input, 0, $length), $expected) === 0); |
|
448 | } |
|
449 | ||
450 | /** |
|
451 | * The input value doesn't start with the expected value |
|
@@ 471-480 (lines=10) @@ | ||
468 | * |
|
469 | * @return boolean |
|
470 | */ |
|
471 | public function endsWith($input, $expected) |
|
472 | { |
|
473 | $length = strlen($expected); |
|
474 | ||
475 | if ($length === 0) { |
|
476 | return true; |
|
477 | } |
|
478 | ||
479 | return (strcasecmp(substr($input, -$length), $expected) === 0); |
|
480 | } |
|
481 | ||
482 | /** |
|
483 | * The input value doesn't end with the expected value |