Functions::startsWith($needle,$haystack)

Version 4

Check if haystack starts with given needle

Check if haystack starts with needle. Returns the remaining part of the haystack, if needle was found. Returns false if is not found.

Return value

Bool|String Haystack without the needle, FALSE if not found

Arguments

$needle string
String to search for
$haystack string
String to search from

Full documentation

Set param if $functionCall starts with 'get'.

if ( $paramName = startsWith('get',$functionCall) ){
    return $this->getParam($paramName);      
}

This function a shorthand for:

if ( strpos($haystack,'get') === 0 ){
    $paramName = substr($haystack , strlen($needle) );
}
else {
    $paramName = false;
}