Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
File_CSV Test Case 012: Read headers
3
--FILE--
4
<?php
5
// $Id: 012.phpt,v 1.2 2007/05/11 21:49:01 cipri Exp $
6
/**
7
 * Test for:
8
 *  - Parsing of headers
9
 */
10
 
11
require_once 'File/CSV.php';
12
 
13
$file = dirname(__FILE__) . '/012.csv';
14
$conf = File_CSV::discoverFormat($file);
15
$conf['header'] = true;
16
 
17
$data = array();
18
File_CSV::read($file, $conf);
19
while ($res = File_CSV::read($file, $conf)) {
20
    $data[] = $res;
21
}
22
 
23
print "Data:\n";
24
print_r($data);
25
print "\n";
26
?>
27
--EXPECT--
28
Data:
29
Array
30
(
31
    [0] => Array
32
        (
33
            [header] => I'm a little header
34
            [body] => this is my teapot
35
            [foot] => can't be!
36
        )
37
 
38
)