public static function openFile($filepath)
    {
        $contents = null;

        if ($realPath = realpath($filepath)) {
            $handle = fopen($realPath, 'rb');
            $contents = fread($handle, filesize($realPath));
            fclose($handle);
        }

        return $contents;
    }
public static function openFile($filepath)
    {
        $contents = null;

        if ($realPath = realpath($filepath)) {
            $handle = fopen($realPath, 'rb');
            $contents = fread($handle, filesize($realPath));
            fclose($handle);
        }

        return $contents;
    }
public static function openFile ( $ filepath ) { $ contents = null ; if ( $ realPath = realpath ( $ filepath ) ) { $ handle = fopen ( $ realPath , 'rb' ) ; $ contents = fread ( $ handle , filesize ( $ realPath ) ) ; fclose ( $ handle ) ; } return $ contents ; }
Binary safe to open file

@param $filepath
@return null|string
Binary safe to open file