Because it's and array!  print and echo take strings, not arrays, I believe.  Anyway, 
print_r() or a foreach loop will do it for you.

<?php 
print_r($table);
//or
foreach ($table as $atable){
echo "$table<Br>";
}
?>

Something like that.

>>> Brian Sutton <[EMAIL PROTECTED]> 12/10/03 01:26PM >>>
I am trying to read in a text file to an array using the following code, 
however everytime I try and print the contents of the $table array, it 
always says "ARRAY".  Why won't it show me the actual contents of the file?

$row = 1;
$handle = fopen ("seclog.txt","r");
while ($data = fgetcsv ($handle, 1000, ",")) {
    $num = count ($data);
    print "<p> $num fields in line $row: <br>\n";
    $row++;
    for ($c=0; $c < $num; $c++) {
        print $data[$c] . "<br>\n";
        $table[] = $data;
    }
}
fclose ($handle);
print $table;

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to