This is my code:
$arr = array();
$dns_1 = mysqli_query($conn, $query);
$dns_2 = mysqli_query($conn, $query);
$d1 = mysqli_fetch_assoc($dns_1);
$d2 = mysqli_fetch_assoc($dns_2);
$arr[1] = $d1;
$arr[2] = $d2;
foreach($arr as $key => $values) {
echo $key."".$values;
}
Output:
Notice: Array to string conversion in C:\xampp\htdocs\index.php on line 79
1Array
Why can't I echo
the $values
in my foreach
??
I don't want to use implode if possible
Thank you!