From a1045c9a5d80adaa5a8ad58e9c630c7e6a3e1a62 Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Mon, 15 Dec 2008 04:44:41 +0000 Subject: lines mode --- it.class | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/it.class b/it.class index 7e6e541..554da52 100644 --- a/it.class +++ b/it.class @@ -697,6 +697,8 @@ function file_get($filename, $p = array()) $result[$arr[0]] = $arr[1]; } } + else if ($p['lines']) + $result = explode("\n", rtrim($data, "\n")); else $result = $data; @@ -713,6 +715,8 @@ function file_put($filename, $data, $p = array()) { if ($p['keyval']) $data = join("", it::map('"$k\t$v\n"', $data)); + else if ($p['lines']) + $data = join("", it::map('"$v\n"', $data)); return file_put_contents($filename == "-" ? "php://stdout" : $filename, $data); } -- cgit v1.2.3