本文整理汇总了PHP中FileReader::seek方法的典型用法代码示例。如果您正苦于以下问题:PHP FileReader::seek方法的具体用法?PHP FileReader::seek怎么用?PHP FileReader::seek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileReader
的用法示例。
在下文中一共展示了FileReader::seek方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseGroup1050
/**
* Parses the coefficient properties of GROUP 1050
*
* @param FileReader $file
*/
protected function parseGroup1050(FileReader $file)
{
$coeffStart = [];
$coeffCount = [];
$coeffSets = [];
$nameLen = ceil($this->const->count() / 10);
$valueLen = ceil($this->const->count() / 3);
// Seek to GROUP 1050 line 1
$file->seek(22 + $nameLen + $valueLen);
foreach (explode(' ', $file->current()) as $i) {
if ($i != '') {
$coeffStart[] = (int) $i;
}
}
// Seek to GROUP 1050 line 2
$file->seek(23 + $nameLen + $valueLen);
foreach (explode(' ', $file->current()) as $i) {
if ($i != '') {
$coeffCount[] = (int) $i;
}
}
// Seek to GROUP 1050 line 3
$file->seek(24 + $nameLen + $valueLen);
foreach (explode(' ', $file->current()) as $i) {
if ($i != '') {
$coeffSets[] = (int) $i;
}
}
// Save coefficient values to properties
$this->coeffStart = $coeffStart;
$this->coeffCount = $coeffCount;
$this->coeffSets = $coeffSets;
}