hi,
I'm on winXPpro / apache 1.2 / php 4.4.x
I'm experimenting with writing and reading from textfiles via php. I can
create a file with fopen, write to it, but I'm having trouble reading
from the file.
here's a snippet:
if (!$keywfile = file("keyw.txt" ) || !$keywfile = file("desc.txt" ))
{
$error = "couldn't open files<br>";
} else {
foreach($keywfi le as $line)
{
$keywords .= $line;
}
foreach($keywfi le as $line)
{
$desc .= $line;
}
}
I get the following error: Warning: "Invalid argument supplied for
foreach() in d:\filesystem\t mp5o3n6eulkr.ph p on line 25"
I checked the file handles with print_r and they both output "1". isn't
the file() function supposed to return an array?I have verified that the
files are not empty.
..soma
I'm on winXPpro / apache 1.2 / php 4.4.x
I'm experimenting with writing and reading from textfiles via php. I can
create a file with fopen, write to it, but I'm having trouble reading
from the file.
here's a snippet:
if (!$keywfile = file("keyw.txt" ) || !$keywfile = file("desc.txt" ))
{
$error = "couldn't open files<br>";
} else {
foreach($keywfi le as $line)
{
$keywords .= $line;
}
foreach($keywfi le as $line)
{
$desc .= $line;
}
}
I get the following error: Warning: "Invalid argument supplied for
foreach() in d:\filesystem\t mp5o3n6eulkr.ph p on line 25"
I checked the file handles with print_r and they both output "1". isn't
the file() function supposed to return an array?I have verified that the
files are not empty.
..soma
Comment