3

How can I convert the array/json into an Excel file (Office Open XML)?

$result = mysql_query($query);
$rows = Array();
while($row = mysql_fetch_assoc($result)) {
    array_push($rows, $row);
}
echo json_encode(Array(
    "data" => $rows
));
ilhan
  • 8,700
  • 35
  • 117
  • 201
  • 1
    There's not a magical convert_to_excel() function, but I believe there are a few libraries for this. Very worst case, the standard for Excel's file format has been published by MS. – Corbin Jun 26 '12 at 09:15

0 Answers0