PHP: startsWith endsWith functions

 
function startsWith($needle, $haystack){  
    return preg_match('/^'.preg_quote($needle)."/", $haystack);  
}  

function endsWith($needle, $haystack){  
    return preg_match("/".preg_quote($needle) .'$/', $haystack);  
}  

No comments:

Post a Comment

Resolving Package Conflict with Level-Zero Installation; Fixing dpkg Error

Preparing to unpack level-zero_1.20.2+u24.04_amd64.deb ... Unpacking level-zero ( 1.20.2 ) ... dpkg: error processing archive level-zero_1....