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

Multiple while loops
I have several DB queries that I know should be returning results and aren't. I have a feeling it ha

Time script, set to my time zone?
I am using this line to get the date and time

Code: $time = date(F." ".d.", &q

About imagecopyresampled()
Hello,

I am looking to use this function to resize parts of an image to a fixed thumbnail siz

How to extract/download content from HTTPS page?
Hello to all the Members of this forum, Im Shoiab, A novice programmer in php.. for my first job I h

Generate multilayered array from string.
ok so i have a string that looks like this:
Code: [Select]blog:edit_all,delete_all|users:edit_all

* Gridview and Detailsview in UpdatePanel, insert mode problem
I have a GridView and DetailsView working together. When a record from Gridview is selected, Detail

please help
HTML Code:

Code: <span id="ctl00"><span>

foreach result into a single variable
Hi,

I have this code...

Code: [Select]foreach ($_POST['Interests'] as $interest =&

SAP Treasury - Commodities
We are running SAP ECC 6.0 with Treasury Activated.
EA-FIN is also activated (SFW5).

session variables not working anymore
hello,
i use sessions to handle authentication within my site. my host has been changing a lot of

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