samkhowaja Posted April 27, 2014 Share Posted April 27, 2014 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 Quote Link to comment https://forums.phpfreaks.com/topic/288059-need-help-with-xml-and-php/ Share on other sites More sharing options...
requinix Posted April 27, 2014 Share Posted April 27, 2014 What have you tried so far and what part of it do you need help with? Quote Link to comment https://forums.phpfreaks.com/topic/288059-need-help-with-xml-and-php/#findComment-1477439 Share on other sites More sharing options...
samkhowaja Posted April 29, 2014 Author Share Posted April 29, 2014 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. Quote Link to comment https://forums.phpfreaks.com/topic/288059-need-help-with-xml-and-php/#findComment-1477605 Share on other sites More sharing options...
Jacques1 Posted April 29, 2014 Share Posted April 29, 2014 Let me Google that for you. No offense, but has it never occured to you that other people may have parsed XML files before you? And that they have created tools and tutorials for exactly this purpose? Quote Link to comment https://forums.phpfreaks.com/topic/288059-need-help-with-xml-and-php/#findComment-1477606 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.