
Fix Uncaught Error Call to undefined function str_starts_with()
2021-04-27 / Dimas Lanjaka
Uncaught Error: Call to undefined function str_starts_with() Fix Solutions

if (!function_exists('str_starts_with')) {
function str_starts_with($haystack, $needle, $case = true)
{
if ($case) {
return strpos($haystack, $needle, 0) === 0;
}
return stripos($haystack, $needle, 0) === 0;
}
}
if (!function_exists('str_ends_with')) {
function str_ends_with($haystack, $needle, $case = true)
{
$expectedPosition = strlen($haystack) - strlen($needle);
if ($case) {
return strrpos($haystack, $needle, 0) === $expectedPosition;
}
return strripos($haystack, $needle, 0) === $expectedPosition;
}
}
Fix Uncaught Error Call to undefined function str_starts_with()
PermaLink: https://www.webmanajemen.com/2021/04/fix-uncaught-error-call-to-undefined.html
Google Rich Snippets | Schema Markup Validator | Google Pagespeed Insight