src/FileUtil.php
public static function read($source, $length = 0)
    {
        if (!is_file($source) || !is_readable($source)) {
            return false;
        }
        try {
            if ($length <= 0 || $length > filesize($source)) {
                return file_get_contents($source);
            }

            $file = @fopen($source, 'r');
            $content = @fread($file, $length);
            @fclose($file);
            return $content;
        } catch (\Exception $e) {
            return false;
        }
    }
public static function read($source, $length = 0)
    {
        if (!is_file($source) || !is_readable($source)) {
            return false;
        }
        try {
            if ($length <= 0 || $length > filesize($source)) {
                return file_get_contents($source);
            }

            $file = @fopen($source, 'r');
            $content = @fread($file, $length);
            @fclose($file);
            return $content;
        } catch (\Exception $e) {
            return false;
        }
    }
public static function read ( $ source , $ length = 0 ) { if ( ! is_file ( $ source ) || ! is_readable ( $ source ) ) { return false ; } try { if ( $ length <= 0 || $ length > filesize ( $ source ) ) { return file_get_contents ( $ source ) ; } $ file = @ fopen ( $ source , 'r' ) ; $ content = @ fread ( $ file , $ length ) ; @ fclose ( $ file ) ; return $ content ; } catch ( \ Exception $ e ) { return false ; } }
read the content from the fle.

@param $source
@param $length int
@return bool|string
read the content from the fle .