i am fetching an array from a PHP file and when I log the array on my console it displays as this: [{"name":"zdfad","email":"XXX","phone":"XXX","id":"0","level":"1"}]
as a string and not the as an array.
how can I fix this? this is the code:
fetch("./php/getuser.php", { method: "GET" })
.then((res) => res.text())
.then((data) => {
console.log(data);
});
res.text()instead ofres.json()?JSON.parse()