开发者

PHP Parsing Question

If I am parsing an rss feed with php and xml, how can I parse more than one feed using one fopen statement. I am currently storing the feeds in different variables, and my fopen statement looks like this:

$fp=fopen($feedzero, $feedone, $feedtwo, "r") 

When I run the code, I get this开发者_StackOverflow中文版 error:

fopen() expects parameter 4 to be resource, string given

Any help appreciated.


http://php.net/manual/en/function.fopen.php explains a bit about fopen function. also using http://framework.zend.com/manual/en/zend.feed.consuming-rss.html would save you from bug hunting


You can't. You'll have to open the files using separate handles and iterate over them separately.

$feedoneFp = fopen($feedone, 'r');
$feedtwoFp = fopen($feedtwo, 'r');
$feedthreeFp = fopen($feedthree, 'r');


fopen expects parameter 4 to be a resource. You gave it a string. It looks like you may have meant to pass in a mode representing "read-only". Mode is the 2nd parameter, not the 4th.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜