header('Content-Description: File Transfer');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="simple.xls"';
header('Content-Transfer-Encoding: binary');
header('Connection: Keep-Alive');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . strlen($content));
function getByColumn(multiArray, column) {
return multiArray.map(data => (typeof data[column] == "object" ? getByColumn(data[column], column) : data[column]) )
}
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_HTTPHEADER , ['Content-Type: multipart/form-data']);
curl_setopt($curl, CURLOPT_POSTFIELDS, ['file' => base64_encode($file_content)]);
// https://www.php.net/manual/en/class.streamwrapper.php
stream_wrapper_register('fakefile', 'FakeFileStreamWrapper');