Added rantest and cqtool to repo
[clearscm.git] / rantest / web / php / exportToCVS.php
1 <?php
2 ////////////////////////////////////////////////////////////////////////////////
3 //
4 // File:        exportToCVS.php
5 // Description: Exports a table to CVS
6 // Author:      Andrew@ClearSCm.com
7 // Created:     Mon Apr 28 15:20:06 MST 2008
8 // Modified:    
9 // Language:    PHP
10 //
11 // (c) Copyright 2000-2008, General Dynamics, all rights reserved.
12 //
13 ////////////////////////////////////////////////////////////////////////////////
14 function exportToCSV ($filename, $data) {
15   header ("Content-Type: application/octect-stream");
16   header ("Content-Disposition: attachment; filename=$filename");
17
18   foreach ($data as $line) {
19     foreach ($line as $key => $value) {
20       if (!$first_time) {
21         print ",\"$value\"";
22       } else {
23         print "\"$value\"";
24       } // if
25     } // foreach
26   } // foreach
27 } // exportToCSV