1

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 error:

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

Any help appreciated.

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

Comments

0

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');

1 Comment

That works. Thank you deceze. By the way, I'm loving the mustache.
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.