When executing this code:
$array =array();
$sqli=mysqli_connect('localhost', 'dbuser', 'pass', 'db');
$query = mysqli_query($sqli,"SELECT * FROM usuarios");
while ($fila = $query->fetch_assoc()) {
$res=array('nombre'=>$fila["nombre"],'tipo'=>$fila["tipo"] 'contraseña'=>$fila["user"]);
array_push($array,$res);
}
header("Content-type:application/json");
echo json_encode($array);
I get this result:
{"nombre":"admin","tipo":"1","contrase\u00f1a":"$2y$10$H5GU7rN38jo3n\/eJW6KMHuovnCFYymi8GrQpshuhowWxYVZdq8r2S"}]
I generate inverted slashes after a /
and I change the ñ
for its html entity How can I fix this?