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 011: Only one field that's multiline with out a EOL and a potential quote inside quotes
3
--FILE--
4
<?php
5
// $Id: 011.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__) . '/011.csv';
16
$conf = File_CSV::discoverFormat($file);
17
 
18
print "Format:\n";
19
print_r($conf);
20
print "\n";
21
 
22
$data = array();
23
while ($res = File_CSV::read($file, $conf)) {
24
    $data[] = $res;
25
}
26
 
27
print "Data:\n";
28
print_r($data);
29
print "\n";
30
?>
31
--EXPECT--
32
Format:
33
Array
34
(
35
    [fields] => 1
36
    [sep] => ,
37
    [quote] => "
38
)
39
 
40
Data:
41
Array
42
(
43
    [0] => Array
44
        (
45
            [0] => I'm multiline
46
Field
47
        )
48
 
49
)