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 028: Variant of 016 with out the sep after the double quotes
3
--FILE--
4
<?php
5
// $Id: 028.phpt,v 1.2 2007/05/11 21:49:01 cipri Exp $
6
/**
7
 * Test for:
8
 * - Like 016 but no sep after the double quote to proof that the sep is the problem
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__) . '/028.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] => 6
35
    [sep] => ,
36
    [quote] => "
37
)
38
 
39
Data:
40
Array
41
(
42
    [0] => Array
43
        (
44
            [0] => Joan "the bone" Anne
45
            [1] => Jet
46
            [2] => 9th, at Terrace plc
47
            [3] => Desert City
48
            [4] => CO
49
            [5] => 00123
50
        )
51
 
52
)