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 bug5257-4: Delimiter problem if first field is empty, extra new line at the end
3
--FILE--
4
<?php
5
// $Id: bug5257-4.phpt,v 1.1 2008/09/21 21:15:44 dufuz Exp $
6
/**
7
 * Test for:
8
 * - File_CSV::readQuoted()
9
 */
10
 
11
require_once 'File/CSV.php';
12
 
13
$file = dirname(__FILE__) . '/bug5257-4.csv';
14
$conf = File_CSV::discoverFormat($file);
15
echo "Discovered fields: $conf[fields]\n";
16
echo "Format:\n";
17
while ($row = File_CSV::readQuoted($file, $conf)) {
18
    print_r($row);
19
    echo "\n";
20
}
21
?>
22
--EXPECT--
23
Discovered fields: 5
24
Format:
25
Array
26
(
27
    [0] => Field 0
28
    [1] => Field 1
29
    [2] => Field 2
30
    [3] => Field 3
31
    [4] => Field 4
32
)
33
 
34
Array
35
(
36
    [0] =>
37
    [1] => Field 1
38
    [2] =>
39
    [3] => Field 3
40
    [4] =>
41
)