Jump to content

andrewgreenwood247@hotmail

Member
  • Posts

    14
  • Joined

  • Last visited

Posts posted by andrewgreenwood247@hotmail

  1. Hi Guys,

     

    I just wanted to thank all of the people who posted above. I had a technical test for a software engineers job on Thursday and it was based on extracting data from numerous xml files.

     

    Without the knowledge you all passed on and with myself having no prior experience with extracting xml data I would have been very stuck indeed!

     

    So, thanks again from a very happy AndyG

     

    Interview is on Thursday, fingers crossed.

  2. Well guys, I have taken the plunge. I bought a new pc today so thought I would start afresh.

     

    So I have Eclipse and I have also decided to change from WAMP to XAMPP. Installing Eclipse was a little fiddly.

     

    If you want to try it iahnalcantara here is the link http://www.eclipse.org/downloads/. choose to download Eclipse for PHP Developers

     

    You will also need a "Java Runtime Environment" which i downloaded here: http://www.oracle.com/technetwork/java/javase/downloads/index.html

     

    If you're used to WAMP, the file stucture is very much different but once you have them all installed, use the readme_en file for guidance.

     

    Took me a while to activate php in XAMPP but now all working fine.

  3. Hi All,

     

    I'm thinking about switching my text editior from notepad++ to Eclipse soon but I just want some feedback from people who maybe using or used it in the past.

     

    From what I have briefly seen on vids, it looks good to use when developing in OOP as you can click on the function/method names and it takes you straight to the file rather than browsing files for hours on end looking for what you want/need.

     

    Thanks

     

    Andy

  4. I'm having the same problem too. with returning values from a method in a class. Confusing isn't it!

     

    just thinking about it now, you could try using return($value); at the end of your function code. Once you have worked out the average value, set that to the $value variable and pass it through the return();

     

    Can't try it out myself as I'm stuck at work for a few more hours, otherwise I would have tried it myself. :(

     

    Im a noob so can't guarantee this will work but just an idea. :)

  5. This will no doubt be considered bad practice, however, becuase I am trying to learn another aspects of web development I like to get other things such as my HTML and CSS done quickly. To do this I use a website which is specifically made to produce your HTML and CSS file/template (no images, just basic structure). As your learning HTML and CSS, maybe do this to take a look at the code but dont get into the habit of using cheat sites, otherwise it will take the fun out of the whole learning curve.

  6. Hey Cody Perry,

     

    I have done a couple of sites based on the xbox theme though I've never actually used an API. The only thing I have needed the player card details. So, If you would like the the old fashioned playercard format (which took me ages to find by the way), you can get the source code from my site atxclan.info/the_team.php

     

    Oh, and there's an API too, I found and saved some PDF files on the web some time ago but I can't remember where I saved them. I'll have a look for them when I get home from work.

  7. <?php 
    
    $xml = simplexml_load_file("xml.xml"); 
    
    foreach($xml->note as $item)  
    { 
    
    if(!$item->name) {
    // no name tag to process
    echo "No items found";
    
    } else {
    
           if ($item->name == "Stan") 
           { //there's a name tag.  check and return if criteria is met.
                   $info = array( 
                   "name" => (string)$item->name, 
                   "number" => (string)$item->number, 
                   "address" => (string)$item->address, 
                   "email" => (string)$item->email 
                   ); 
           break; 
           } 
    }
    } 
    
    
           // Item was found and now returned 
           echo "<pre>"; 
           print_r($info); 
           echo "</pre>"; 
    
    
    ?>
    

     

    I was thinking something along the lines of the above.

    But, I'm at work now and can't try any of them out. :(

     

    Thanks BeeDev

     

    Just thought I would add onto this... I've just read the "Help Vampires" post, I hope I'm not deemed as a "Help Vampire". :(

  8. However, keep in mind that you still need to figure out what to do if the correct record doesn't exist

    Hi Ben,

     

    I had a look at this last night and tried to figure out what code I would write to account for a record that didn't exist. Again, I'm baffled.

     

    Any ideas?

     

    Regards

     

    Andy

  9. Ah, Thanks Ben, That is what I was looking for.

     

    So, Say if each item had it's own unique id (in this case the telephone number) I could add further agruments to the "if" statement?

     

    Like this...

     

    if ($item->name == "Stan" && $item->number == "+44325656565")

     

    Thanks for your help on this guys (both Benjamin and Ben), it's very much appreciated.

  10. Hi All,

     

    I've watched the tutorial which shows how we can return the first 5 records from XML data. It all makes sense, however, what I would like to do is return specific data. See attachment...

     

    phonebook.xml

     

    I would like to return the record where <name></name> = Stan including all other elements relating to the record (number, address and email), But how would I code this in simplexml?

     

    I assume it will be similar to the tutorial with some kind of arguement but I am well and truely stuck here...

     

    Thanks

     

    Andy

×
×
  • Create New...