37 if (!file_exists(
$file))
return false;
38 $fh = fopen(
$file,
'r');
39 if (!$fh)
return false;
49 if (!file_exists(
$file))
return false;
51 $fh = fopen(
$file,
'r');
52 if (!$fh)
return false;
74 if ($line ===
false)
break;
75 $line = rtrim($line,
"\n\r");
76 if (!$state && $line ===
'')
continue;
77 if ($line ===
'----')
break;
78 if (strncmp(
'--#', $line, 3) === 0) {
81 } elseif (strncmp(
'--', $line, 2) === 0) {
83 $state = trim($line,
'- ');
84 if (!isset(
$ret[$state]))
$ret[$state] =
'';
88 if (strpos($line,
':') !==
false) {
90 list($state, $line) = explode(
':', $line, 2);
102 $ret[$state] .=
"$line\n";
104 }
while (!feof($fh));
parseHandle($fh)
Internal parser that acepts a file handle.
parseFile($file)
Parses a file that contains a single string-hash.
Parses string hash files.
parseMultiFile($file)
Parses a file that contains multiple string-hashes delimited by '-—'.