本文整理汇总了PHP中FileReader::splitCurrent方法的典型用法代码示例。如果您正苦于以下问题:PHP FileReader::splitCurrent方法的具体用法?PHP FileReader::splitCurrent怎么用?PHP FileReader::splitCurrent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileReader
的用法示例。
在下文中一共展示了FileReader::splitCurrent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseGroup1040and1041
/**
* Parses the constant values from GROUP 1040 and 1041
*
* @param FileReader $file
*/
protected function parseGroup1040and1041(FileReader $file)
{
$coeffNames = [];
$coeffValues = [];
// Seek to start of GROUP 1040, and store the total number of constants
$file->seek(14);
$count = (int) trim($file->current());
// Parse each constant header
$i = 0;
while ($i < $count) {
$file->next();
foreach ($file->splitCurrent(' ') as $coeff) {
$coeffNames[] = $coeff;
$i++;
}
}
// Seek to the begining of GROUP 1041
$file->seek(18 + ceil($count / 10));
// Parse each constant value
$i = 0;
while ($i < $count) {
$file->next();
foreach ($file->splitCurrent(' ') as $value) {
$coeffValues[] = static::evalNumber($value);
$i++;
}
}
// Create a new constant instance and store each of the coefficients
$this->const = new Constant();
for ($i = 0; $i < count($coeffNames); $i++) {
$this->const->{$coeffNames[$i]} = $coeffValues[$i];
}
}