# XML Feed with value?

**URL:** <https://forum.kirupa.com/t/xml-feed-with-value/187867>\
**Category:** programming\
**Created:** [May 2, 2006, 9:09pm UTC](https://forum.kirupa.com/t/xml-feed-with-value/187867 "2006-05-02T21:09:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dalton](https://avatars.discourse-cdn.com/v4/letter/d/76d3ee/32.png) [@Dalton](https://forum.kirupa.com/u/Dalton)\
**Post date:** [May 2, 2006, 9:09pm UTC](https://forum.kirupa.com/t/xml-feed-with-value/187867/1 "2006-05-02T21:09:26Z")

</div>

Ok, Ive just started to learn how to use xml feeds, I picked up most of it in about a day, one thing I do not understand is how to access a certain tag with a value.  
Im using

```auto

$xml = simplexml_load_file("news.xml");
foreach ($xml->news as $news) {
// echo content here
} 

```

(pretty simple)

and I have an xml file

```auto

<post>
<news id="15">
<author>Dalton</author>
<story>blah</story>
</news>
<news id="14">
<author>Dalton</author>
<story>blah</story>
</news>
</post>

```

Now, on to my point, I want to echo only the news where the id=“14” so it will only display where \<news id=“14”\>\</news\>.

I have asked so many people on how to do this and no one can seem to explain it to me, haha. PLEASE HELP.

Thanks,  
Dalton Conley
