Continent Names for HTML Drop-Down, PHP, JavaScript Arrays, and SQL


This article provides a list of continent names which can be used anywhere in Web Development and Programming. Whether you are building HTML dropdown menus, filling PHP arrays with continent names, coding JavaScript functions or constructing SQL databases etc. these set of continent name makes it regular and easy to your work.

HTML Dropdown for Continents

Use the following code to create a drop-down menu with continent names in HTML

HTML
<select id="continent" name="continent" class="form-select" aria-label="Select Continent">
  <option>select continent</option>
  <option value="AF">Africa</option>
  <option value="AN">Antarctica</option>
  <option value="AS">Asia</option>
  <option value="OC">Australia (Oceania)</option>
  <option value="EU">Europe</option>
  <option value="NA">North America</option>
  <option value="SA">South America</option>
</select>
Continents

JavaScript Array of Continents

Use the following JavaScript code to create an array of continent names

JS Continent Names

JavaScript
const continents = ["Africa", "Antarctica", "Asia", "Europe", 
	    		"North America", "Australia", "South America"];

JS Continents Code

JavaScript
const continentsCode = ["AF","AN","AS","OC","EU","NA","SA"]

JS Array of Object Code and Name

JavaScript
const continents = [
    {"code": "AF", "name": "Africa"},
    {"code": "AN", "name": "Antarctica"},
    {"code": "AS", "name": "Asia"},
    {"code": "OC", "name": "Australia (Oceania)"},
    {"code": "EU", "name": "Europe"},
    {"code": "NA", "name": "North America"},
    {"code": "SA", "name": "South America"}
];

JS Object Code and Name

JavaScript
const continentsObject = {
    "AF": "Africa",
    "AN": "Antarctica",
    "AS": "Asia",
    "OC": "Australia (Oceania)",
    "EU": "Europe",
    "NA": "North America",
    "SA": "South America"
};

PHP Array of Continents

Use the following PHP code to create an array of continent names

PHP Continent Names

PHP
<?php
$continents = ["Africa", "Antarctica", "Asia", "Europe", 
	    		"North America", "Australia", "South America"];
?>

PHP Continents Code

PHP
<?php
	$continentsCode = ["AF","AN","AS","OC","EU","NA","SA"];
?>

PHP Array of Object Code and Name

PHP
<?php
$continents = [
    ["code" => "AF", "name" => "Africa"],
    ["code" => "AN", "name" => "Antarctica"],
    ["code" => "AS", "name" => "Asia"],
    ["code" => "OC", "name" => "Australia (Oceania)"],
    ["code" => "EU", "name" => "Europe"],
    ["code" => "NA", "name" => "North America"],
    ["code" => "SA", "name" => "South America"]
];
?>

PHP Object Code and Name

PHP
<?php
$continentsObject = [
    "AF" => "Africa",
    "AN" => "Antarctica",
    "AS" => "Asia",
    "OC" => "Australia (Oceania)",
    "EU" => "Europe",
    "NA" => "North America",
    "SA" => "South America"
];
?>

SQL Table for Continents

Use the following SQL code to create a table and insert continent names

SQL
CREATE TABLE IF NOT EXISTS `continents` (
    `id` TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
    `code` CHAR(2) NOT NULL,
    `name` VARCHAR(30) NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `code` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

INSERT INTO `continents` (`id`, `code`, `name`) VALUES
(1, 'AF', 'Africa'),
(2, 'AN', 'Antarctica'),
(3, 'AS', 'Asia'),
(4, 'EU', 'Europe'),
(5, 'OC', 'Australia'),
(6, 'NA', 'North America'),
(7, 'SA', 'South America');

Click the button download SQL continents

Download

Use Cases of Continents

  • Geographical Data Organization: Use continent data for maps, educational tools, and data visualization projects.

  • Form Inputs: Include continent dropdowns in web forms for user profiles, travel bookings, and surveys.

  • Data Analysis and Reports: Use continent-based data for statistical analysis, market research, and regional reports.

  • Educational Resources: Create interactive learning modules, quizzes, and games for geography education.

  • Content Personalization: Customize content based on user's continent for targeted marketing, news, and services.

  • Sports: Organize international sports events on a continental basis, like the African Cup of Nations or European Championships.