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 032: One row, four fields that are multiline with out a EOL and span couple of lines
3
--FILE--
4
<?php
5
// $Id: 032.phpt,v 1.2 2007/05/11 21:49:01 cipri Exp $
6
/**
7
 * Test for:
8
 * - Varian of test 011 but a lot longer
9
 * data gotten from http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm
10
 */
11
 
12
require_once 'File/CSV.php';
13
 
14
$file = dirname(__FILE__) . '/032.csv';
15
$conf = File_CSV::discoverFormat($file);
16
 
17
print "Format:\n";
18
print_r($conf);
19
print "\n";
20
 
21
$data = array();
22
while ($res = File_CSV::read($file, $conf)) {
23
    $data[] = $res;
24
}
25
 
26
print "Data:\n";
27
print_r($data);
28
print "\n";
29
?>
30
--EXPECT--
31
Format:
32
Array
33
(
34
    [fields] => 4
35
    [sep] => ,
36
    [quote] => "
37
)
38
 
39
Data:
40
Array
41
(
42
    [0] => Array
43
        (
44
            [0] => I'm multiline
45
Field
46
that spans
47
over couple
48
of
49
rather odd
50
sections
51
of the
52
world
53
            [1] => Helgi
54
            [2] => foobar
55
            [3] => And I'm another
56
        )
57
 
58
)