Il modo PHP standard per verificare se una stringa $strtermina con una sottostringa $testè:
$endsWith = substr( $str, -strlen( $test ) ) == $test
È questo il modo più veloce?
s($str)->endsWith($test)o s($str)->endsWithIgnoreCase($test)utile, come si trova in questa libreria standalone .