data = []; foreach(explode("\n", $text) as $line) { $row = explode(':', $line); if(count($row) > 1 && !empty(trim($row[0]))) $this->data[trim($row[0])] = trim($row[1]); } // logger($text); } public function value($key) { return $this->data[$key] ?? null; } }