From a54dfdefc913bb821d8fa4ec9d2242295f6aa034 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 20 Dec 2016 17:54:10 +0100 Subject: [PATCH] trim string --- header.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/header.php b/header.php index 166b9c97..39146967 100644 --- a/header.php +++ b/header.php @@ -58,11 +58,11 @@ if(count($data) > 0) { foreach ($data as $line) { - $expl = explode(":", $line); + $expl = explode(":", trim($line)); if(count($expl) == 2) { - // remove " kB" fron the end of the string and make an integer - $meminfo[$expl[0]] = intVal(substr(trim($expl[1]),0, -3)); + // remove " kB" from the end of the string and make it an integer + $meminfo[$expl[0]] = intVal(substr($expl[1],0, -3)); } } $memory_used = $meminfo["MemTotal"]-$meminfo["MemFree"]-$meminfo["Buffers"]-$meminfo["Cached"];