how to write this correctly?
for($i=2;$i<5;$i++)
{
$items{$i} = $doc{$i}->getElementsByTagName('url');
}
got an error:
Fatal error: Call to a member function getElementsByTagName() on a non-object
Thanks,
bye
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This test worked for me:-
So, your code should look like this:-
Unless you mean for $items to be an array, in which case it should look like this:-