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

  • SEARCH
  • Home
  • 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 8193715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:34:40+00:00 2026-06-07T04:34:40+00:00

I have an array containing country codes and country names. I need to echo

  • 0

I have an array containing country codes and country names. I need to echo a country from the array.

I have the country code which works as the key of the array:

AG

When I do a var_dump

var_dump($country_list);

I receive the following:

array(224) { [""]=> string(19) "Select a country..." ["AF"]=> string(11) "Afghanistan" ["AL"]=> string(7) "Albania" ["DZ"]=> string(7) "Algeria" ["AD"]=> string(7) "Andorra" ["AO"]=> string(6) "Angola" ["AI"]=> string(8) "Anguilla" ["AQ"]=> string(10) "Antarctica" ["AG"]=> string(19) "Antigua and Barbuda" ["AR"]=> string(9) "Argentina" ["AM"]=> string(7) "Armenia" ["AW"]=> string(5) "Aruba" ["AU"]=> string(9) "Australia" ["AT"]=> string(7) "Austria" ["AZ"]=> string(10) "Azerbaijan" ["BS"]=> string(7) "Bahamas" ["BH"]=> string(7) "Bahrain" ["BD"]=> string(10) "Bangladesh" ["BB"]=> string(8) "Barbados" ["BY"]=> string(7) "Belarus" ["BE"]=> string(7) "Belgium" ["BZ"]=> string(6) "Belize" ["BJ"]=> string(5) "Benin" ....

How can I echo the country name where the country code is: AG

It may seem simple to some but I am having difficulties.

  • 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-07T04:34:41+00:00Added an answer on June 7, 2026 at 4:34 am

    You can just simple echo it

    echo $country_list['AG'];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an int array containing gray scale values from 0-254, i also have
I have create an array containing person firstname,lastname and number which i populate in
I have an array containing the contents of a MySQL table. I need to
I have an array containing multiple rowsets, including type, title and description....i need to
This is an additional question from this . I have this array containing multiple
I have an array containing names of items. I want to give the user
I'm using javascript, and I have an array containing multiple values, which may be
I have an array containing a large number of contents Names = [one, two,
I have got an array containing unique elements. I need to find out the
Let's say I have an array containing Blocks, and I need to assert that

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.