|
Server : LiteSpeed System : Linux host 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64 User : idnco5810 ( 1093) PHP Version : 8.2.29 Disable Function : NONE Directory : /home/idn98.co/public_html/wp-content/plugins/amp/includes/utils/ |
Upload File : |
<?php
/**
* Class AMP_String_Utils
*
* @package AMP
*/
/**
* Class with static string utility methods.
*
* @internal
*/
class AMP_String_Utils {
/**
* Checks whether a given string ends in the given substring.
*
* @param string $haystack Input string.
* @param string $needle Substring to look for at the end of $haystack.
* @return bool True if $haystack ends in $needle, false otherwise.
*/
public static function endswith( $haystack, $needle ) {
return '' !== $haystack
&& '' !== $needle
&& substr( $haystack, -strlen( $needle ) ) === $needle;
}
}