DOMDocument parsing


Posted on 16th Feb 2014 07:03 pm by admin

Hello, I am parsing an xml file from an API which I have converted into a DOMDocument in php. This is mostly fine but one problem I have is when I do this:
Code: [Select]$feeditem->getElementsByTagName('extra');
as part of a forall statment and the element extra doesn't exist in one of the feeditems I am iterating through in the forall condition then I get an error.

Did you know?Explore Trending and Topic pages for more stories like this.
I think I need some kind of statment like:

Code: [Select]if ($feeditem->getElementsByTagName('extra') ISN'T NULL)
But don't know how to formulate it. Please help. Thanks.
No comments posted yet

Your Answer:

Login to answer
133 Like 5 Dislike
Previous forums Next forums
Other forums

IMAGE - SERVER SIDE scripting help...
How to receive pixel data of an image and buid a bitmap file on the server using the HTTP POST metho

Displaying image pathname instead of image
Hello

Im trying to upload and then display images from a mysql database - Its only basic and

New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understan

Count on multidimensional array
Hi, i got an array as below:

Array
(
=> Array
(

System copy error in RUN ABAP REPORT PHASE
Hi,
I am performing system copy on my test server. I have previously taken export of JAVA + A

please help me... my password gets encrypted but not able to get in database
hai guys,
please help me... in the following function my password gets encrypted but no

shoping cart issues
i´ve wrote this and works when i add an item to, my cart, but when i want to add othrer item just

need help with this contact form
I made this form and I need it to read the data and write the data to a table and its not working ca

Calander Basic Spript help
hi, just starting out with PHP and have the following script:

<?php
//This gets t

Bar charts using Graphical Framework.
I am using Graphical Frameworks(GFW) to create a chart Graphic . There is no problem with the data d

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash