Jump to content

Need help with XML and PHP.


samkhowaja

Recommended Posts

searching using php.
I have an xml file with these data.

<entries>

<!-- Begin New York -->
<entry>
<id>1</id>
        <title>418 Central Prk West</title>
        <imageUrl>/sliderFeatured320x190_001.jpg</imageUrl>
<imageThumbUrl>/listThumbApartments50x50_001.jpg</imageThumbUrl>
<price>4,427</price>
<address>418 Central Prk West, 105, Manhattan</address>
<reviews>If you are searching for an apartment in Clementon or relocating to Blackwood, then come to Cherrywood and enjoy the best apartments in Clementon, NJ.</reviews>
<latitude>40.795457</latitude>
        <longitude>-73.962151</longitude>
<featured>1</featured>
<telNo>(877) 957-5246</telNo>
<checkInTime>Today 3:00 am - 5:00 pm</checkInTime>
<date>January 22, 2013</date>
<categoryId></categoryId>
<zipCode>10025</zipCode>
<noOfRooms>3</noOfRooms>
<bathrooms>2</bathrooms>
<apartmentType>Condominium</apartmentType>
<rating>1</rating>
</entry>

<entry>
<id>2</id>
        <title>66 E. 11 St.</title>
        <imageUrl>/sliderFeatured320x190_002.jpg</imageUrl>
<imageThumbUrl>/listThumbApartments50x50_002.jpg</imageThumbUrl>
<price>4,591</price>
<address>66 E. 11 St., Manhattan</address>
<reviews>When we first walked to the apartments it was completely filthy...on the outside there was an old broken down vehicle next to our place and the door had ...</reviews>
<latitude>40.733041</latitude>
        <longitude>-73.992181</longitude>
<featured>1</featured>
<telNo>(310) 272-8002</telNo>
<checkInTime>Today 4:00 am - 5:00 pm</checkInTime>
<date>Febuary 26,2013</date>
<categoryId></categoryId>
<zipCode>10002</zipCode>
<noOfRooms>20</noOfRooms>
<bathrooms>10</bathrooms>
<apartmentType>Condominium</apartmentType>
<rating>2</rating>
</entry>

I just want to search for ID using value and then echo all the other elements. i am waiting for reply

Link to comment
Share on other sites

I getting ID from another page using $GET method, now I want to search for the ID XML where the value is 2 and echo complete record which has ID 2.

In the above xml sample entry 2 has ID 2 now i want to search that specific entry and echo all of the items entry 2 has.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.