From 6a025484bb0486dd57012539e609829f6d796528 Mon Sep 17 00:00:00 2001 From: Goeran Heinemann Date: Sun, 8 Mar 2020 12:57:10 +0100 Subject: [PATCH] test tode --- parse-worldometers.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parse-worldometers.php b/parse-worldometers.php index a510b63..da1bcdf 100755 --- a/parse-worldometers.php +++ b/parse-worldometers.php @@ -2,7 +2,7 @@ query($sql); $data = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach ($data as $scan){ @@ -21,8 +21,9 @@ foreach ($data as $scan){ $country = array(); $p2 = $parts[$i]->childNodes; $country[] = $p2[0]->textContent; + $deaths = (strpos($p2[6]->textContent, "+") !== false?$p2[6]->textContent:0); $country[] = intval(str_replace(",", "", $p2[2]->textContent)); - $country[] =intval(str_replace(",", "", $p2[6]->textContent)); + $country[] =intval(str_replace(",", "", $deaths)); $country[] =intval(str_replace(",", "", $p2[10]->textContent)); $country[] =intval(str_replace(",", "", $p2[12]->textContent)); $document[] = $country;