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 010: Empty first field and no quoting but some fields have extra spacing
3
--FILE--
4
<?php
5
// $Id: 010.phpt,v 1.2 2007/05/11 21:49:01 cipri Exp $
6
/**
7
 * Test for:
8
 * - parsing, how we handle quotes and separators inside quotes
9
 *   and empty fields
10
 * data gotten from http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm
11
 */
12
 
13
require_once 'File/CSV.php';
14
 
15
$file = dirname(__FILE__) . '/010.csv';
16
$conf = File_CSV::discoverFormat($file);
17
 
18
$data = array();
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
            [0] =>
34
            [1] => Blankman
35
            [2] =>
36
            [3] => SomeTown
37
            [4] => SD
38
            [5] => 00298
39
        )
40
 
41
)