www.webdeveloper.com
Results 1 to 1 of 1

Thread: How do you call specific array from an XML file to PHP

  1. #1
    Join Date
    May 2009
    Posts
    129

    How do you call specific array from an XML file to PHP

    Hi all,

    I'm trying to connect to an API right now and I'm wondering how you call a specific pocket from an array which is located in an XML file. My terminology may be wrong, but allow me to show you some of the code that I've got.

    PHP Code:
    <?php 

    echo base::CallAPI ('AccountInfo');

    ?>
    This will show me the following
    email$amountUSD2009-10-24 09:32:01
    Basically, it is taking my account name, the amount of money I have, currency, date/time and putting it altogether in a not so neat way.

    When I put in the code
    PHP Code:
    <pre><?php 

    print_r
    (base::ParseXML(base::CallAPI('AccountInfo'))); 
    ?></pre>
    It shows the following..

    Array
    (
    [Email] => my email
    [Credits] => amount of money I have in my account
    [Currency] => USD
    [Server.Time] => 2009-10-24 09:32:01
    )
    What I would like to do is to call just the e-mail and credits part and take out the currency as well as server.time. So ideally, I'd like it to look like this...

    E-mail: _________
    Credits: _____________
    As I'm sure many of you can tell, I'm very new to php, but any help would be fantastic!
    Last edited by smoh; 10-24-2009 at 04:41 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles