Jump to content

jamiesalter

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.jbhhockey.co.uk

Profile Information

  • Gender
    Not Telling

jamiesalter's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello all, I'm having problems using simpleXML in PHP.  I am trying to assign an elements data to a variable.  Normally the following would work: [color=blue]$xml = simplexml_load_file($file); foreach ($xml->item as $item) { $manu = trim(addslashes($item->manufacturer)); ... }[/color] However my problem occurs when the elements name contains a colon.  For example, if instead of [color=blue]$item->manufacturer[/color] it was [color=blue]$item->g:brand[/color] php produces an error because of the colon producing an invalid variable name.  Is it possible to escape the colon somehow, whilst still instructing simpleXML to get the data of g:brand? Any comments or help would be gratefully appreciated, Jamie Salter jbhhockey.co.uk
  2. Hi, I'm a complete newbie to this forum (as you can probably see from my post count), but was wondering if you could advice me in some way. Basically, I have just started up a website ([url=http://www.jbhhockey.co.uk]http://www.jbhhockey.co.uk[/url]) that aims to provide a price comparison for various field hockey sticks in the UK.  The site is currently run on PHP5 and MySQL5.  I was thinking that I would ask retailers to supply me with a CSV file of all their hockey sticks, which would be hosted on their website, and then create a php script or robot of some sort that would scan these files for any changes in price every month/week.  So when they change the price of a stick, they update their CSV file, and it would automatically be reproduced on my website. Firstly, is this the best way of doing it (I'm guessing probably not)?  Also, do you know what the major price comparison sites do (eg. kelkoo, dealtime, pricerunner etc)?  And lastly, do you think that what I outlined above would actually work? Regards, Jamie Salter JBHHockey.co.uk
×
×
  • 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.