Jump to content

knutsford

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

1 Neutral

About knutsford

  • Rank
    Newbie

Profile Information

  • Gender
    Male
  1. knutsford

    $xml->xpath

    It is ok I have now managed it. I needed $nodes = $xml->xpath("//item//g:id[contains(text(),'$code')]/following-sibling::g:link"); $field = "g:link"; $url = ""; foreach($nodes as $node) { $url = (string)$node[0]; } It is ages since I have done anything with xml so I was rather rusty
  2. knutsford

    $xml->xpath

    <rss version="2.0"> <channel> <title>Big Game Hunters Online Store</title> <link>https://www.biggamehunters.co.uk/</link> <description>Products available from Big Game Hunters</description> <item> <g:id>88205</g:id> <g:title> Bee Ball Basketball Stand - BB-05 (1.6m to 2.1m) </g:title> <g:description> The BB-05 Stand by Bee Ball has a large rectangular backboard measuring 80cm x 58cm. This is similar to the shape to that of professional units and therefore offers better shooting practise than curved backboards.
  3. knutsford

    $xml->xpath

    I am trying to do a search to get a url in PHP I have tried $the_id = $item['id']; $nodes = $xml->xpath("//item[contains(g:id,'$the_id')]"); foreach($nodes as $node) { $url = $node->g:link; } How do I do it? $url = $node->g:link; gives a syntax error Do I ignore g: and use id and link Thanks The xml layout is <item> <g:id>2023</g:id> <g:title> Croquet Set - Townsend </g:title> <g:description> Already a v
  4. Thanks. I can do it with JavaScript without a problem. I just thought I would try required instead but I had no idea what to use for the pattern
  5. If you use <input required> how do you stop it from allowing just spaces and how do you make sure there is a minimum entry of 8 non spaces. Thanks
  6. knutsford

    laterooms

    Possibly slightly better but still slow. I think the main problem is laterooms sending back so much information that is is slowing it down at their end
  7. knutsford

    laterooms

    I am calling the xml file from laterooms using $xml = simplexml_load_file("http://xmlfeed.laterooms.com/index.aspx?aid=11929&rtype=4&kword=" . $County[0]); where $County[0] is the county name The I am using a loop to echo the contents of 5 of the child nodes foreach ($xml->hotel as $hotel){ } It is very slow so is there a quicker way of using the xml file? There are umpteen child nodes for each Hotel which I don't need which will be slowing it down to start with. Thanks
×
×
  • Create New...