<?php function str_ends_with($haystack, $needle){ return substr_compare($haystack, $needle, -strlen($needle)) === 0; }