From f2ab6d16a26834a000c909b08a9aae2a4c70578c Mon Sep 17 00:00:00 2001 From: Goeran Heinemann Date: Sun, 8 Mar 2020 13:24:20 +0100 Subject: [PATCH] tode --- parse-worldometers.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/parse-worldometers.php b/parse-worldometers.php index b6044c5..cec4c13 100755 --- a/parse-worldometers.php +++ b/parse-worldometers.php @@ -2,7 +2,8 @@ query($sql); $data = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach ($data as $scan){ @@ -21,7 +22,10 @@ foreach ($data as $scan){ $country = array(); $p2 = $parts[$i]->childNodes; $country[] = $p2[0]->textContent; - $deaths = (strpos($p2[6]->textContent, "+") !== false?0:$p2[6]->textContent); + for ($j=0; $j < $p2->length; $j++){ + var_dump($p2[$j]->textContent); + } + $deaths = (strpos($p2[6]->textContent, "+") !== false?$p2[8]->textContent:$p2[6]->textContent); $country[] = intval(str_replace(",", "", $p2[2]->textContent)); $country[] =intval(str_replace(",", "", $deaths)); $country[] =intval(str_replace(",", "", $p2[10]->textContent));