/dev/null;"); /* (3) Clean output */ $out = preg_replace('/^\s+/', '', $out); $out = preg_replace('/\s+$/', '', $out); /* (4) Manage result */ if( is_numeric($out) && $out === "0" ) return true; elseif( is_numeric($out) && $out === "127" ) return false; else return $out; } /* [2] Log management =========================================================*/ function slog($message="unknown error", $feature="main", $flag="daemon"){ file_put_contents(LOG_DIR."/$flag.log", time()." [$feature] $message\n", FILE_APPEND); } ?>