ReadTrait
trait ReadTrait
Class Read
Methods
static array|bool
load(string $src, string $format = self::FORMAT_PHP)
No description
static array
loadPhp(string $file, bool $throwError = true)
load array data form file.
static array
loadJson(string $file)
No description
static array|bool
loadIni(string $ini)
No description
static array|bool
loadYml(string $yml)
No description
static array|string
readAllLine($file, bool|true $filter = true)
No description
static array
readLines(string $fileName, int $startLine = 1, int $endLine = 10, string $mode = 'rb')
getLines 获取文件一定范围内的内容
static array
readSymmetry(string $fileName, integer $current = 1, integer $lineNum = 3)
symmetry 得到当前行对称上下几($lineNum)行的内容
static array
readRangeLines(string $file, int $baseLine, int $prevLines = 3, int $nextLines = 3)
No description
static array
getLines5u3d(string $file, int $baseLine = 1)
得到基准行数上5行下3行的内容, lines up and down
static array
tail(resource $fp, int $n, int $base = 5)
读取文件的最后几行(支持大文件读取)
Details
at line 31
static array|bool
load(string $src, string $format = self::FORMAT_PHP)
at line 64
static array
loadPhp(string $file, bool $throwError = true)
load array data form file.
at line 85
static array
loadJson(string $file)
at line 94
static array|bool
loadIni(string $ini)
at line 103
static array|bool
loadYml(string $yml)
at line 115
static array|string
readAllLine($file, bool|true $filter = true)
at line 137
static array
readLines(string $fileName, int $startLine = 1, int $endLine = 10, string $mode = 'rb')
getLines 获取文件一定范围内的内容
at line 191
static array
readSymmetry(string $fileName, integer $current = 1, integer $lineNum = 3)
symmetry 得到当前行对称上下几($lineNum)行的内容
at line 212
static array
readRangeLines(string $file, int $baseLine, int $prevLines = 3, int $nextLines = 3)
at line 227
static array
getLines5u3d(string $file, int $baseLine = 1)
得到基准行数上5行下3行的内容, lines up and down
at line 240
static array
tail(resource $fp, int $n, int $base = 5)
读取文件的最后几行(支持大文件读取)