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

Detectron2 + PyTorch CPU : Fix Install issue

Detectron2 + PyTorch CPU ❌ The error $ pip install -q --extra-index-url https://download.pytorch.org/whl/cpu torch torchvision $ pip inst...