Re: Why Does "function endElement($parser, $name)" Do This?
- From: maria <maria@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 01:41:40 -0500
On Fri, 29 Feb 2008 01:38:39 -0500, maria <maria@xxxxxxxxxxxxxxxxxxx>
wrote:
This is kind of strange.
I open a stream called $fh with name, say, "maria", before the
function below, and then I try to write into the file "maria" to no
avail! I keep getting the error:
"fwrite(): supplied argument is not a valid stream resource in ... ".
We can't use a stream to write into inside endElement?
Here is the function
function endElement($parser, $name) {
global $insideitem, $tag, $title, $description, $link;
if ($name == "ITEM") {
fwrite($fh,$title);
printf("<dt><b><a
href='%s'>%s</a></b></dt>",trim($link),htmlspecialchars(trim($title)));
printf("<dd>%s</dd>",htmlspecialchars(trim($description)));
$title = "";
$description = "";
$link = "";
$insideitem = false;
}
}
It is part of a PHP-program that reads RSS files and saves them with
certain format added. Everything else works fine.
This piece of code is not mine.
Please help!
maria
BTW,
It won't write into the stream $fh no matter what I try to write.
Thanks!
maria
.
- References:
- Prev by Date: Why Does "function endElement($parser, $name)" Do This?
- Next by Date: Re: Apache vs IIS
- Previous by thread: Why Does "function endElement($parser, $name)" Do This?
- Next by thread: Re: Why Does "function endElement($parser, $name)" Do This?
- Index(es):
Relevant Pages
|