while (true) {
$line = next($lines);
if ($line === false) break;
+ if ($line == 'PHP Credits') break; # No more interrested
// Section
if (strpos($line, '_______') === 1) {
$section = next($lines);
}
#bye($section);
- if ($section == 'PHP Credits') break; # No more interrested
continue;
}
// Sub
- if (substr(trim($line), -1) !== ',' and !strpos($line, '=>')) {
+ if (!empty($line) and substr(trim($line), -1) !== ',' and !strpos($line, '=>')) {
$sub = $line;
+ #bye($sub);
continue;
}
// Key => Val
- if (preg_match('/(.*) => (.*)/',$line,$m)) {
+ $keyVal = explode(' => ',$line);
+ if (count($keyVal)>1) {
+ $key = array_shift($keyVal);
+ $val = array_shift($keyVal);
+
+ // Add multi lines values
+ while (substr(trim($line), -1) === ',') {
+ $line = next($lines);
+ if ($line === false) break;
+ $val .= ' '.$line;
+ }
+
+ #if ($key == 'Additional .ini files parsed') continue;
$rows[] = [
'section' => $section,
'sub' => $sub,
- 'key' => $m[1],
- 'val' => $m[2],
+ 'key' => $key,
+ 'val' => $val,
];
}
- // Vals multi lines
- while (substr(trim($line), -1) === ',') {
- $line = next($lines);
- if ($line === false) break;
- #bye($line);
- #$row = end($rows);
- $idx = key($rows);
- $rows[$idx]['val'] .= ' '.$line;
- }
-
}
+
$this->page($rows);
#$this->page($this,'phpinfo_rows');