1)Be il file csv è un file ascii con i campi separati dal punto e virgola...non credo serva una funzione particolare.
2)Ecco un metodo che fa distinzione anche col browser che usi:
codice:// SE IL BROWSER E' INTERNET EXPLORER (This should work for IE & Opera) if(ereg("MSIE ([0-9].[0-9]{1,2})", $_SERVER['HTTP_USER_AGENT'])) { header("Content-Type: application/vnd.ms-excel"); //determines file type ('.xls') header("Content-Disposition: inline; filename=database_dump.xls"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Pragma: public"); } else { // (This should work for the rest) header("Content-Type: application/vnd.ms-excel"); //determines file type ('.xls') header("Content-Disposition: attachment; filename=database_dump.xls"); header("Expires: 0"); header("Pragma: no-cache"); }

Rispondi quotando