Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8396571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:34:10+00:00 2026-06-09T20:34:10+00:00

below codes is json(a part only) , I have to put into a combo

  • 0

below codes is json(a part only) , I have to put into a combo box whole currencies.

{
    "AED": "United Arab Emirates Dirham",
    "AFN": "Afghan Afghani",
    "ALL": "Albanian Lek",
    "AMD": "Armenian Dram",
    "ANG": "Netherlands Antillean Guilder",
    "AOA": "Angolan Kwanza",
    "ARS": "Argentine Peso"
}

I have try up to here…

$ch2 = curl_init("http://openexchangerates.org/api/currencies.json");
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1);

// Get the data:
$json2 = curl_exec($ch2);
curl_close($ch2);

$currency->LKR; // Here I can retreive a single line

// Decode JSON response:
$currency = json_decode($json2);

I have to put into a combo box whole currencies.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:34:12+00:00Added an answer on June 9, 2026 at 8:34 pm

    Assuming your $currency arrays looks like

    $currency = array('AED' => 'United Arab Emirates Dirham' ...... );
    

    //then just do foreach

    $opts = '';
    foreach($currency as $key => $val)
    {
    
    $opts .= '<option value="'.$key.'">'.$val.'</option>';
    }
    
    echo  '<select name="currency">'.$opts.'</select>;
    

    Thiss should output something like …

    <select name="currency">
    <option value="AED">United Arab Emirates Dirham</option>
    <option value="AFN">Afghan Afghani</option>
    
    .....
    
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a working JavaScript code below which dynamically creates JSON object using JSON.parse
these below codes give whole data of my Rehber datas. But if i want
using the below code for decoding json $categories = json_decode($data); $categories = $categories->data; where
I'm using the code below for Android JSON parsing but I am getting the
Following is my code with the business logic. I get below json by calling
This below codes give me error below: How to generate this codes help me
How can i shorter below codes than before? i need short and simple method:
I used codes below to display a image on an UIBarButtonItem UIBarButtonItem *myButtonItem; myButtonItem=
Look please below this codes throw me : FormatException was unhandled by user code
I use the codes below to read and write a bool value from my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.