Completed
Push — master ( 392919...e6b269 )
by Michal
02:52
created

read.php ➔ display_file()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 23
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 16
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 23
rs 9.0856
1
<?php
2
/**
3
 * Displays content of given file
4
 *
5
 * @param string $filename File to open
6
 */
7
function display_file($filename)
8
{
9
    $shp = new ShapeFile(1);
10
    $shp->loadFromFile($filename);
11
12
    $i = 1;
13
    foreach ($shp->records as $i => $record) {
14
        echo "<pre>";
15
        echo "Record No. $i:\n\n\n";
16
        // All the data related to the record
17
        echo "SHP Data = ";
18
        print_r($record->SHPData);
19
        print_r("\n\n\n");
20
        // All the information related to each record
21
        echo "DBF Data = ";
22
        print_r($record->DBFData);
23
        print_r("\n\n\n");
24
        echo "</pre>";
25
    }
26
27
    echo "The ShapeFile was completely readed.<br />\n";
28
    echo "Return to the <a href='index.php'>index</a>.";
29
}
30