Why Does "function endElement($parser, $name)" Do This?
- From: maria <maria@xxxxxxxxxxxxxxxxxxx>
- Date: Fri, 29 Feb 2008 01:38:39 -0500
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
.
- Follow-Ups:
- Re: Why Does "function endElement($parser, $name)" Do This?
- From: Jerry Stuckle
- Re: Why Does "function endElement($parser, $name)" Do This?
- From: maria
- Re: Why Does "function endElement($parser, $name)" Do This?
- Prev by Date: Re: Apache vs IIS
- Next by Date: Re: Why Does "function endElement($parser, $name)" Do This?
- Previous by thread: Apache vs IIS
- Next by thread: Re: Why Does "function endElement($parser, $name)" Do This?
- Index(es):
Relevant Pages
|