trim string

This commit is contained in:
DL6ER
2016-12-20 17:54:10 +01:00
parent b3907ea570
commit a54dfdefc9
+3 -3
View File
@@ -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"];