src/Util.php
private static function removePrefix($str, $prefix)
    {
        if (substr($str, 0, strlen($prefix)) == $prefix) {
            return substr($str, strlen($prefix));
        }
        return null;
    }
private static function removePrefix($str, $prefix)
    {
        if (substr($str, 0, strlen($prefix)) == $prefix) {
            return substr($str, strlen($prefix));
        }
        return null;
    }
private static function removePrefix ( $ str , $ prefix ) { if ( substr ( $ str , 0 , strlen ( $ prefix ) ) == $ prefix ) { return substr ( $ str , strlen ( $ prefix ) ) ; } return null ; }
Removes a prefix from the start of a string if it exists, or null otherwise.

@param  string $str
@param  string $prefix
@return null|string
Removes a prefix from the start of a string if it exists or null otherwise .