src/Lib/StringTool.php
public static function start_with($string, $needle, $case_sensitive = true)
    {
        if(!is_string($string))
        {
            $string = (string)$string;
        }
        
        if(!is_string($needle))
        {
            $needle = (string)$needle;
        }
        
        if($case_sensitive)
        {
            return strpos($string, $needle) === 0;
        }
        else
        {
            return stripos($string, $needle) === 0;
        }
    }
public static function start_with($string, $needle, $case_sensitive = true)
    {
        if(!is_string($string))
        {
            $string = (string)$string;
        }
        
        if(!is_string($needle))
        {
            $needle = (string)$needle;
        }
        
        if($case_sensitive)
        {
            return strpos($string, $needle) === 0;
        }
        else
        {
            return stripos($string, $needle) === 0;
        }
    }
public static function start_with ( $ string , $ needle , $ case_sensitive = true ) { if ( ! is_string ( $ string ) ) { $ string = ( string ) $ string ; } if ( ! is_string ( $ needle ) ) { $ needle = ( string ) $ needle ; } if ( $ case_sensitive ) { return strpos ( $ string , $ needle ) === 0 ; } else { return stripos ( $ string , $ needle ) === 0 ; } }
Tests if a string starts with a given string

@param     string
@param     string
@return    bool
Tests if a string starts with a given string