B
bmisericorde
Guest
Here is what my code looks like:
<?php
$filename='inventory.txt';
$fp = fopen($filename, 'r');
if ($fp) {
$array = explode("\n", fread($fp, filesize($filename)));
}
$numlines=count($array);
for ($i=0;$i<$numlines;$i++){
print $array;
}
?>
For some reason, I get the output ArrayArrayArrayArray
i want the file read and output line by line, using only the newline as a seperator
tried
print $array(i);
said "function name must be a string."
okay, my c++ talking, used
$array;
no output at all.
Okay, was using i instead of $i, thank you.
<?php
$filename='inventory.txt';
$fp = fopen($filename, 'r');
if ($fp) {
$array = explode("\n", fread($fp, filesize($filename)));
}
$numlines=count($array);
for ($i=0;$i<$numlines;$i++){
print $array;
}
?>
For some reason, I get the output ArrayArrayArrayArray
i want the file read and output line by line, using only the newline as a seperator
tried
print $array(i);
said "function name must be a string."
okay, my c++ talking, used
$array;
no output at all.
Okay, was using i instead of $i, thank you.