Jump to content

seanmt

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

seanmt's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Anybody have any ideas? I'm absolutely stumped with this.
  2. I am trying to put the tree of an XML file into an array. sample.xml <?xml version='1.0' encoding='UTF-8'?> <getHistogramsResponse xmlns="http://www.ebay.com/marketplace/search/v1/services"> <ack>Success</ack> <version>1.7.0</version> <timestamp>2010-09-01T12:13:31.480Z</timestamp> <aspectHistogramContainer> <domainName>UK_CamerasPhoto_DigitalCameras_DigitalCameras_JN</domainName> <domainDisplayName>Digital Cameras</domainDisplayName> <aspect name="Brand"> <valueHistogram valueName="Canon"> <count>4323</count> </valueHistogram> <valueHistogram valueName="Sony"> <count>2210</count> </valueHistogram> </aspect> </aspectHistogramContainer> </getHistogramsResponse> $this->cXmlToArray->m_arr = GetXMLTree('sample.xml') if (isset($this->cXmlToArray->m_arr['getHistogramsResponse']['aspectHistogramContainer'][0])) { $this->m_arrResult = $this->cXmlToArray->m_arr['getHistogramsResponse']['aspectHistogramContainer']; } else if (count($this->cXmlToArray->m_arr['getHistogramsResponse']['aspectHistogramContainer']) > 0) { $this->m_arrResult[] = $this->cXmlToArray->m_arr['getHistogramsResponse']['aspectHistogramContainer']; } However my output is showing as: Array ( [0] => Array ( [domainName] => UK_CamerasPhoto_DigitalCameras_DigitalCameras_JN [domainDisplayName] => Digital Cameras [aspect] => Array ( [0] => Array ( [valueHistogram] => Array ( [0] => Array ( [count] => 4311 ) [1] => Array ( [count] => 2209 ) ) ) ) So how do I get it to return the attributes name and valueName? Any help will be greatly appreciated.
  3. Ah yes it makes sense to just output the data seeing as I am accessing the database anyway and writing it to a file. All sorted now thanks guys.
  4. I'm reading data from a database and writing it to an XML file. I then read the content of that file and parse the XML data. It is a little cache script so it only writes data every 180 seconds, whenever it writes data the filesize that is retrieved is still the old file size before the new data was written. This leads to an XML error... The XML error I get: XML error: no element found at line 39 $fp = fopen($file,"r") while (($data = fread($fp, filesize($file)))) { xml_parse($xml_parser, $data, feof($fp)); } fclose($fp);
  5. Yes it does (see attachment). Yes I believe so. It's been on my computer a long time now though so I am not 100% sure. [attachment deleted by admin]
  6. I think that could be it. Except I have tried loads of different font sizes but to no avail. They all have the weird shaped M & N's. I have given up and resorted to using a different font now.
  7. Any other ideas as to why it doesn't display correctly?
  8. It doesn't. Like I say i used it for months before hand. It only started looking like that when I changed server. I have it on my PC and here is what it looks like... [attachment deleted by admin]
  9. The font definitely exists. I just deleted them from the server and all the bits of text that use that font disappeared completely.
  10. I recently moved servers and since then I have noticed that one line of text is showing weirdly. I have attached an example image that was generated. In the word 'Managing' the letters M & N are being distorted. The bit of code that creates that line of text is... $silk = 'fonts/slkscr.ttf'; $grey = imagecolorallocate($im, 49, 51, 61); imagefttext($im, 6, 0, 73, 25, $grey, $silk, 'Managing'); [attachment deleted by admin]
  11. Ah nevermind. I tried using imagesavealpha again but this time I used it correctly. Doh. $im = imagecreatefrompng("backgrounds/bg7.png"); // // misc operations on the image... // //JUST ADDED THESE 2 LINES TO MY CODE AND IT ALL WORKS FINE NOW imagealphablending($im, false); imagesavealpha($im, true); imagepng($im);
  12. Hi, I'm having a bit of trouble with PHP & GD. I want the background of the image to be transparent but when I create a new image using... $im = imagecreatefrompng("backgrounds/bg7.png"); The resulting image just ends up with horrible black colour around the edge of it (as seen in the attached image). The original image can be seen here. All help will be much appreciated. [attachment deleted by admin]
×
×
  • 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.