<?php
/****************************************/
/*                                      */
/*  百信卡盟平台联系QQ:84945491         */
/*  淘宝店 http://shop70674652.taobao.com  */
/*  百信卡盟 http://www.caipiaobus.com  */
/*                                      */
/****************************************/

class csv
{

				public function __construct( )
				{
				}

				public function output( $data, $filename )
				{
								header( "Content-Type: application/csv; charset=UTF-8" );
								header( "Pragma: public" );
								header( "Expires: 0" );
								header( "Cache-Control: must-revalidate, post-check=0, pre-check=0" );
								header( "Content-Type: application/force-download" );
								header( "Content-Type: application/octet-stream" );
								header( "Content-Type: application/download" );
								header( "Content-Disposition: attachment;filename=".$filename.".csv " );
								header( "Content-Transfer-Encoding: binary " );
								foreach ( $data as $item )
								{
												$str = implode( ",", $item )."\r\n";
												echo $str;
								}
				}

}

?>
