12 lines
483 B
PHP
12 lines
483 B
PHP
|
<?php
|
||
|
function ends_with($stringToCheck, $stringToFind)
|
||
|
{
|
||
|
return strlen($stringToCheck) >= strlen($stringToFind) &&
|
||
|
substr(strtolower($stringToCheck), strlen($stringToCheck) - strlen($stringToFind), strlen($stringToFind)) == strtolower($stringToFind);
|
||
|
}
|
||
|
|
||
|
function starts_with($stringToCheck, $stringToFind)
|
||
|
{
|
||
|
return strlen($stringToCheck) >= strlen($stringToFind) &&
|
||
|
substr(strtolower($stringToCheck), 0, strlen($stringToFind)) == strtolower($stringToFind);
|
||
|
}
|