Domanda

Sto producendo dati dal mio DB a Excel (deve essere un formato .xls), ma come faccio a dire a Excel di inserire i dati in una nuova cella o di avviare una nuova linea?

/** Set the headers */
header('Content-type: application/vnd.ms-excel');
header('Content-disposition: attachment;filename=referrals.xls');

/** Output the column headers (We don't need the ID, so drop it) */
foreach($referrals[0] as $key => $value) :
    $array_keys[$key] = $key;
endforeach;
unset($array_keys['ID']);
echo join('???', $array_keys).'New row???';

/** Output the data */
foreach($referrals as $referral) : foreach($referral as $key => $value) :
        $referral_array[$key] = $value;
    endforeach;
    unset($referral_array['ID']);
    echo join('???', $referral_array).'New row???';
endforeach;

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top