Hi there everybody.
I'm having a problem with a script I'm
doing. My script should open a specific text
file on my server (in the same dir) and show
the results on screen.
Let me show you what I've got.
test.php
<?php
$textfile="test.txt";
$buffer=file($textfile);
reset($buffer);
print '<table border=3><tr>';
while (list($key, $user) = each ($buffer)) {
$pieces = explode (",", $user);
if (is_int($i/2)) {
print '<td>'. $pieces .'</td></tr><tr>';
} else {
print '<td>'. $pieces .'</td>';
}
}
print '</tr></table>';
?>
test.txt
value1a,value1b
value2a,value2b
value3a,value3b
value4a,value4b
When I execute this script above, I get the
following on screen:
Array
Array
Array
Ofcourse, I want EACH value, (e.g. value1a,
value1b,value2a, etc. etc.) to be seperated.
Ofcourse I'm missing something in my script
up there. I just don't know what.
If somebody can tell me why I'm getting these
Array error messages or maybe explain a bit
more on how to split up data obtained from a
txt file I'd greatly appreciate it.
Thank you in advance!
Greetings,
Spider