29 static function toArray($kvs, $strict=
false)
31 $lines = explode(
"\n", $kvs);
33 $last = array_pop($lines);
35 array_push($lines, $last);
43 for ($lineno = 0; $lineno < count($lines); $lineno++) {
44 $line = $lines[$lineno];
45 $kv = explode(
':', $line, 2);
46 if (count($kv) != 2) {
63 if ($tval != $value) {
69 $values[$tkey] = $tval;
83 if ($values === null) {
90 foreach ($values as $key => $value) {
91 if (is_array($value)) {
92 list($key, $value) = array($value[0], $value[1]);
95 if (strpos($key,
':') !==
false) {
99 if (strpos($key,
"\n") !==
false) {
103 if (strpos($value,
"\n") !==
false) {
106 $serialized .=
"$key:$value\n";