I'm trying to get an array with utf-8 values from an MS-SQL query.
Nearly everything works fine, except that the result array looks like this:
Array (
[id] => 1;
[0] => 1; // this is redundant
[countryName] => england;
[1] => england; // this is redundant
)
I don't want the duplicate numeric keys. Why are they even created? The code which is leading to this result is:
# execute the query
foreach ($pdoConnection->query($sqlStatement) as $row) {
// encode row in utf8 so json works and save row in array
$output[] = array_map('utf8_encode', $row);
}
Thanks for any idea how that can be solved.