Array Functions in PHP

1. array_change_key_case :- 

It changes all the keys of  an array in uppercase.

<?php
$employee_id=array("Jim"=>"40535","Krish"=>"83007","Joe"=>"41233");
print_r(array_change_key_case($employee_id,CASE_UPPER));
?>

Output
Array ( [JIM] => 40535 [KRISH] => 83007 [JOE] => 41233 )

 

2. array_chunk :-

It is used to split an array in small (piece) portion.

<?php
$students_name=array("Kiran","Krish","Diva","Veena","Seema","Sam");
print_r(array_chunk($students_name,4));
?>

Output
Array ( [0] => Array ( [0] => Kiran [1] => Krish [2] => Diva [3] => Veena ) [1] => Array ( [0] => Seema [1] => Sam ) )

 

 3. array_column  :-

It returns the value in a single column last name of a recordset.

<?php
$students_details = array(
  array(
    'roll_no' => 100,
    'first_name' => 'Sam',
    'last_name' => 'Barco',
  ),
  array(
    'roll_no' => 101,
    'first_name' => 'Welban',
    'last_name' => 'Alberto',
  ),
  array(
    'roll_no' => 102,
    'first_name' => 'Joe',
    'last_name' => 'Alves',
  )
);

$last_names = array_column($students_details, 'last_name');
print_r($last_names);
?>

Output
Array ( [0] => Barco [1] => Alberto [2] => Alves )

 

4. array_combine :-

It is used to create  an array by using the components  from one array key.

<?php
$name=array("Krish","Ben","Diva");
$age=array("25","27","23");
$details=array_combine($name,$age);
print_r($details);
?>

Output
Array ( [Krish] => 25 [Ben] => 27 [Diva] => 23 )

 

5. array_count_value :-

It is used to count all the value of an array.

<?php
$brand=array("A","Datsun","Tata","B","BMW","MINI");
print_r(array_count_values($brand));
?>

Output
Array ( [A] => 1 [Datsun] => 1 [Tata] => 1 [B] => 1 [BMW] => 1 [MINI] => 1 )

 

5. array_diff_assoc :-

It is used to compare the two arrays and return a differences.

<?php
$array1=array("a"=>"Ford","b"=>"Jaguar","c"=>"Bugatti","d"=>"Renault");
$array2=array("a"=>"Jaguar","b"=>"Bugatti","c"=>"Ford");

$result=array_diff_assoc($array1,$array2);
print_r($result);
?>

.Output
Array ( [a] => Ford [b] => Jaguar [c] => Bugatti [d] => Renault )

 

6. array_key_diff :-

It is used to compare the keys of two arrays and return a difference.

<?php
$brand1=array("a"=>"Land Rover","b"=>"Fiat","c"=>"Geely");
$brand2=array("d"=>"Peugeot","b"=>"Fiat","a"=>"Land Rover");

$result=array_diff_key($brand1,$brand2);
print_r($result);
?>

Output
Array ( [c] => Geely )

 

7. array_diff_uassoc :-

It is used to compare the key and the value of (user-defined) function of an array and return a difference.

<?php
function myfunction($brand1,$brand2)
{
if ($brand1===$brand2)
  {
  return 0;
  }
  return ($brand1>$brand2)?1:-1;
}

$car_brand1=array("a"=>"Porsche","b"=>"Subaru","c"=>"Nissan");
$car_brand2=array("d"=>"Subaru","b"=>"Subaru","e"=>"Nissan");

$result=array_diff_uassoc($car_brand1,$car_brand2,"myfunction");
print_r($result);
?>

Output
Array ( [a] => Porsche [c] => Nissan )

8. array_diff_ukey :-

It is used to compare the key of an array using a user-define function or comparsion function and return a difference.

<?php
function myfunction($brand1,$brand2)
{
if ($brand1===$brand2)
  {
  return 0;
  }
  return ($brand1>$brand2)?1:-1;
}

$car_brand1=array("a"=>"Porsche","b"=>"Subaru","c"=>"Nissan");
$car_brand2=array("a"=>"Subaru","b"=>"Subaru","e"=>"Nissan");

$result=array_diff_ukey($car_brand1,$car_brand2,"myfunction");
print_r($result);
?>

Output
Array ( [c] => Nissan )

 

9. array_diff :-

It is used to compare the value of  two arrays and return a differences.

<?php
$array1=array("a"=>"Ford","b"=>"Jaguar","c"=>"Bugatti","d"=>"Renault");
$array2=array("e"=>"Jaguar","f"=>"Bugatti","g"=>"Ford");

$result=array_diff($array1,$array2);
print_r($result);
?>

Output
Array ( [d] => Renault )

 

10. array_fill_keys :- 

It is used  to fill the array with the value by defining Keys.

<?php
$keys=array("One","Two","Three","Four");
$array1=array_fill_keys($keys,"Bike");
print_r($array1);
?>

Output
Array ( [One] => Bike [Two] => Bike [Three] => Bike [Four] => Bike )

 

11. array_fill :-

It is used to fill the array with the value.

<?php
$array1=array_fill(3,4,"Food");
$array2=array_fill(0,3,"Drink");
print_r($array1);
echo "<br>";
print_r($array2);
?>

Output
Array ( [3] => Food [4] => Food [5] => Food [6] => Food ) 
Array ( [0] => Drink [1] => Drink [2] => Drink )

 

12. array_filter :-

By using a callback function, it is used to filter the value of an array.

<?php
function odd_num($var)
{
return($var & 1);
}

$num=array("a","b",9,76,4);
print_r(array_filter($num,"odd_num"));
?>

Output
Array ( [2] => 9 )

 

13. array_flip :-

It is used to flip the keys from the cojoin value in an array.

<?php
$test=array("a"=>"Amit","b"=>"Kiran","c"=>"Diva","d"=>"Ravi");
$result=array_flip($test);
print_r($result);
?>

Output
Array ( [Amit] => a [Kiran] => b [Diva] => c [Ravi] => d )

 

14. array_intersect_assoc :-

It matches the keys and value of two arrays and return the match result.

<?php
$brand1=array("a"=>"Honda ","b"=>" Mahindra","c"=>"Ducati ","d"=>"KTM");
$brand2=array("b"=>" Mahindra","c"=>"Ducati ","d"=>"KTM");

$result=array_intersect_assoc($brand1,$brand2);
print_r($result);
?>

Output
Array ( [b] => Mahindra [c] => Ducati [d] => KTM )

15. array_intersect_key :-

It matches the keys of two arrays and return the match result.

<?php
$brand1=array("a"=>"Honda ","b"=>" Mahindra","c"=>"Ducati ","d"=>"KTM");
$brand2=array("a"=>" Mahindra","b"=>"Ducati ","c"=>"KTM");

$result=array_intersect_key($brand1,$brand2);
print_r($result);
?>

Output
Array ( [a] => Honda [b] => Mahindra [c] => Ducati )

 

16. array_intersect_uassoc :-

It is used to figure out the interchange of two arrays and return the match result by using user-defined function.

<?php
function myfunction($x,$y)
{
if ($x===$y)
  {
  return 0;
  }
  return ($x>$y)?1:-1;
}

$brand1=array("x"=>"Kopiko","b"=>"Parle","c"=>"Cocon");
$brand2=array("y"=>"Kopiko","b"=>"Parle","e"=>"Cocon");

$result=array_intersect_uassoc($brand1,$brand2,"myfunction");
print_r($result);
?>

Output
Array ( [b] => Parle )

 

17. array_intersect_ukey :-

It is used to figure out the interchange of two arrays keys and return the match result by using user-defined function.

<?php
function myfunction($a,$b)
{
if ($a===$b)
  {
  return 0;
  }
  return ($a>$b)?1:-1;
}

$candy1=array("a"=>"Kopiko","b"=>"Parle","c"=>"Cocon");
$candy2=array("a"=>"Kopiko","b"=>"Parle","e"=>"Cocon");

$result=array_intersect_ukey($candy1,$candy2,"myfunction");
print_r($result);
?>

Output
Array ( [a] => Kopiko [b] => Parle )

 

18. array_intersect :-

It is used to match the two arrays and return a match result.

<?php
$name1=array("a"=>"Kiran","b"=>"Diva","c"=>"Sam","d"=>"Raj");
$name2=array("e"=>"Kiran","f"=>"Sam","g"=>"Diva");

$result=array_intersect($name1,$name2);
print_r($result);
?>

Output
Array ( [a] => Kiran [b] => Diva [c] => Sam )

 

19. array_key_exists :-

It is used to check whether the key or index is present in the array.

<?php
$car_average=array("Maruti Suzuki"=>"22kmpl","Tata Tiago"=>"23.84kmpl");
if (array_key_exists("Tata Tiago",$car_average))
  {
  echo "Key exists!";
  }
else
  {
  echo "Key does not exist!";
  }
?>

Output
Key exists!

 

20. array_keys :-

It is used to return a key or a batch of key of an array.

<?php
$car=array("Tata Tiago"=>"23.84kmpl","Hyundai i20"=>"18.60kmpl","Renault Kwid"=>"23.17kmpl");
print_r(array_keys($car));
?>

Output
Array ( [0] => Tata Tiago [1] => Hyundai i20 [2] => Renault Kwid )

 

21. array_map :-

array_map() function is use for applying a function to all the array elements. It traverse all the value of array and apply the given function and store the returned result into result array and return the result array.

<?php
function myfunction($number)
{
  return($number*$number);
}

$num=array(3,2,3,4,9);
print_r(array_map("myfunction",$num));
?>

Output
Array ( [0] => 9 [1] => 4 [2] => 9 [3] => 16 [4] => 81 )

 

22. array_merge_recursive :-

It is used to combine two arrays into one array.

<?php
$name1=array("a"=>"Sam","b"=>"Joy","c"=>"Kiran");
$name2=array("d"=>"Diva","e"=>"Sunny");
print_r(array_merge_recursive($name1,$name2));
?>

Output
Array ( [a] => Sam [b] => Joy [c] => Kiran [d] => Diva [e] => Sunny )

 

23. array_replace :-

It is used to replace the value of the first array with the value of the second array.

<?php
$name1=array("Sam","John");
$name2=array("Diva","kiran");
print_r(array_replace($name1,$name2));
?>

Output
Array ( [0] => Diva [1] => kiran )

 

24. array_reverse :-

It is used to return an array in inverse order.

<?php
$car_name=array("a"=>"Tata","b"=>"BMW","c"=>"Toyota");
print_r(array_reverse($car_name));
?>

Output
Array ( [c] => Toyota [b] => BMW [a] => Tata )

 

25. array_search :-

It is used to search the array of the given value and return a key of that value.

<?php
$car_name=array("a"=>"Tata","b"=>"BMW","c"=>"Toyota");
echo array_search("BMW",$car_name);
?>

Output
b

 

26. array_shift :-

It is used to remove the first component from an array and return the value of removing components.

<?php
$name=array("a"=>"John","b"=>"Jyoti","c"=>"Chavvi");
echo array_shift($name)."<br>";
print_r ($name);
?>

Output
John
Array ( [b] => Jyoti [c] => Chavvi )

 

27. array_slice :-

It is used to chop (slice) an array of the given component and return the rest of the components of an array.

<?php
$name=array("John","Kiran","Jyoti","Ravi","Chavvi");
print_r(array_slice($name,3));
?>

Output
Array ( [0] => Ravi [1] => Chavvi )

 

28. array_splice :-

It is used to remove the components of the first array and replace with the new components.

<?php
$name1=array("a"=>"John","b"=>"Kiran","c"=>"Ravi","d"=>"Chavvi");
$name2=array("a"=>"Jyoti","b"=>"Suman");
array_splice($name1,0,2,$name2);
print_r($name1);
?>

Output
Array ( [0] => Jyoti [1] => Suman [c] => Ravi [d] => Chavvi ) 

 

29. array_sum :-

It is used to calculate the sum of the array and return a result.

<?php
$array=array(50,159,125);
echo array_sum($array);
?>

Output
334

 

30. array_udiff_assoc :-

It is used to correlate the key and the value of two arrays using a user defined function to compare value and built-in function to compare keys  and return the inequality.

<?php
function sumfunction($x,$y)
{
if ($x===$y)
  {
  return 0;
  }
  return ($x>$y)?1:-1;
}

$x1=array("a"=>"Sunny","b"=>"kiran","c"=>"Gaurav");
$x2=array("a"=>"Sunny","b"=>"Diva","c"=>"Gaurav");

$result=array_udiff_assoc($x1,$x2,"sumfunction");
print_r($result);
?>

Output
Array ( [b] => kiran )

 

31. array_udiff :-

It is used to correlate the value of  user define function of two arrays and return an inequality.

<?php
function myfunction($a,$b)
{
if ($a===$b)
  {
  return 0;
  }
  return ($a>$b)?1:-1;
}

$array1=array("a"=>"Sunny","b"=>"Gaurav","c"=>"kiran");
$array2=array("a"=>"Joy","b"=>"Diva","e"=>"kiran");

$result=array_udiff($array1,$array2,"myfunction");
print_r($result);
?>

Output
Array ( [a] => Sunny [b] => Gaurav )

 

32. array_uintersect_assoc :-

It is used to correlate the key and the value of two arrays using a user-defined function to compare value and built-in function to compare keys  and return the matches.

<?php
function sumfunction($x,$y)
{
if ($x===$y)
  {
  return 0;
  }
  return ($x>$y)?1:-1;
}

$x1=array("a"=>"Sunny","b"=>"kiran","c"=>"Gaurav");
$x2=array("a"=>"Sunny","b"=>"Diva","c"=>"Gaurav");

$result=array_uintersect_assoc($x1,$x2,"sumfunction");
print_r($result);
?>

Output
Array ( [a] => Sunny [c] => Gaurav )

 

33. array_uintersect_uassoc :-

It is used to correlate the key and the value of two arrays using a two user-define function for correlation and return the matches.

<?php
function myfunction_key($x,$y)
{
if ($x===$y)
  {
  return 0;
  }
  return ($x>$y)?1:-1;
}

function myfunction_value($x,$y)
{
if ($x===$y)
  {
  return 0;
  }
  return ($x>$y)?1:-1;
}

$array1=array("a"=>"Honda","b"=>"Tata","c"=>"Swift");
$array2=array("a"=>"Honda","b"=>"Tata","c"=>"Tata");

$result=array_uintersect_uassoc($array1,$array2,"myfunction_key","myfunction_value");
print_r($result);
?>

Output
Array ( [a] => Honda [b] => Tata )

 

34. array_uintersect  :-

It is used to correlate the key and value of two array using a user-define function for correlation and return the matches.

<?php
function myfunction($x,$y)
{
if ($x===$y)
  {
  return 0;
  }
  return ($x>$y)?1:-1;
}

$array1=array("a"=>"Honda","b"=>"Tata","c"=>"Swift");
$array2=array("a"=>"Swift","b"=>"BMW","e"=>"Swift");

$result=array_uintersect($array1,$array2,"myfunction");
print_r($result);
?>

Output
Array ( [c] => Swift )

 

35. array_unique  :-

It is used to dismiss all the duplex value from the array.

<?php
$car=array("a"=>"BMW","b"=>"Tata","c"=>"BMW");
print_r(array_unique($car));
?>

Output
Array ( [a] => BMW [b] => Tata )

 

36. array_unshift  :-

It is used to add one more component at the beginning of the array.

<?php
$brand=array("a"=>"BMW","b"=>"Audi");
array_unshift($brand,"Audi");
print_r($brand);
?>

Output
Array ( [0] => Audi [a] => BMW [b] => Audi )

 

37. array_values  :-

It is used to return all the value from an array.

<?php
$student=array("Name"=>"Diva","Age"=>"21","Country"=>"India");
print_r(array_values($student));
?>

Output
Array ( [0] => Diva [1] => 21 [2] => India )

 

38. array :-

It is used to create an array. It stores multiple value in a single variable.

<?php
$cars = array("Audi", "BMW", "Ferrari", "Aston"); 
echo "Latest car brand " . $cars[0] . ", " . $cars[1] . ", " . $cars[2] . " and " . $cars[3] . ".";
?>

Output
Latest brand Audi, BMW, Ferrari and Aston.

 

39. arsort :-

It makes the batches of associative array descending order on the basis of value.

<?php
$student_age=array("Sunny"=>"25","Diva"=>"27","Kiran"=>"24");
arsort($student_age);

foreach($student_age as $a=>$a_value)
   {
   echo "Key=" . $a . ", Value=" . $a_value;
   echo "<br>";
   }
?>

Output
Key=Diva, Value=27
Key=Sunny, Value=25
Key=Kiran, Value=24

 

40. asort :-

It makes the batches of associative array ascending order on the basis of value.

<?php
$student_age=array("Sunny"=>"25","Diva"=>"27","Kiran"=>"24");
asort($student_age);

foreach($student_age as $a=>$a_value)
   {
   echo "Key=" . $a . ", Value=" . $a_value;
   echo "<br>";
   }
?>

Output
Key=Kiran, Value=24
Key=Sunny, Value=25
Key=Diva, Value=27

 

41. compact :-

It is used to create an array of from variables and their values.

<?php
$firstname = "Sunny";
$lastname = "Singh";
$age = "11";
$address = "23/9 Mall road Pune";

$result = compact("firstname", "lastname", "age", "address");

print_r($result);
?>

Output
Array ( [firstname] => Sunny [lastname] => Singh [age] => 11 [address] => 23/9 Mall road Pune )

 

42. count :-

It is used to count all the components in an array and return a number as a result. 

<?php
$name=array("Vikas","Diva","Sunny","Kajal");
echo count($name);
?>

Output
4

 

43. current :-

It is used to return the present component of an array.

<?php
$menu_list = array("Hachis Parmentier", "Raclette", "Chicken Marengo", "Jambon-beurre");
echo current($menu_list);
?>

Output
Hachis Parmentier

 

44. each :-

It returns the present key and value combination from an array leading the array cursor.

<?php
$menu_list = array("Hachis Parmentier", "Raclette", "Chicken Marengo", "Jambon-beurre");
print_r (each($menu_list));
?>

Output
Array ( [1] => Hachis Parmentier [value] => Hachis Parmentier [0] => 0 [key] => 0 )

 

45. end :-

It is used to return the last component of an array.

<?php
$name = array("Joe", "John", "Rikka", "Kiran");

echo current($name) . "<br>";
echo end($name);
?>

Output
Joe
Kiran

 

46. extract :-

It is used to assign the value in  the key and return a result.

<?php
$x = "Original";
$name = array("x" => "Gaurav","y" => "Kiran", "z" => "Neha");
extract($name);
echo "\$x = $x; \$y = $y; \$z = $z";
?>

Output
$x = Gaurav; $y = Kiran; $z = Neha

 

47. in_array :-

It is used to check value present in an array or not.

<?php
$country = array("India", "Australia", "England", "Ethiopia");

if (in_array("Australia", $country))
  {
  echo "Country found in the list";
  }
else
  {
  echo "Country not found in  the list";
  }
?>

Output
Country found in the list

48. key_exists :-

It is used to check value present in an array or not.

<?php
$country=array("India"=>"Australia","England"=>"Ethiopia");
if (array_key_exists("India",$country))
  {
  echo "Country exists!";
  }
else
  {
  echo "Country does not exist!";
  }
?>

Output
Country exists!

49. key :-

It is used to fetch the key from an array and return the private index position.

<?php
$country=array("India","Australia","England","Ethiopia");
echo "The key from the current position is: " . key($country);
?>

Output
The key from the current position is: 0

50. krsort :-

It is used to sort the array in reverse order according to the key.

<?php
$Employee_id=array("Kiran"=>"2335","Diva"=>"3457","Joe"=>"4389");
krsort($Employee_id);

foreach($Employee_id as $x=>$x_value)
   {
   echo "Key=" . $x . ", Value=" . $x_value;
   echo "<br>";
   }
?>

Output
Key=Kiran, Value=2335
Key=Joe, Value=4389
Key=Diva, Value=3457

51. list :-

It is used to assign the value in an array.

<?php
$student = array("Priya","Sam","Lucky");

list($a, $b, $c) = $student;
echo "There are few students present in class,  $a,  $b and  $c.";
?>

Output
There are few students present in class, Priya, Sam and Lucky.

52. natsort :-

It is used to sort the array in natural order by using an algorithm.

<?php
$mp3_files = array("audio1.mp3","audio21.mp3",
"audio11.mp3","audio16.mp3","audio81.mp3");

sort($mp3_files);
echo "Standard sorting: ";
print_r($mp3_files);
echo "<br>";

natsort($mp3_files);
echo "Natural order: ";
print_r($mp3_files);
?>

Output
Standard sorting: Array ( [0] => audio1.mp3 [1] => audio11.mp3 [2] => audio16.mp3 [3] => audio21.mp3 [4] => audio81.mp3 ) 
Natural order: Array ( [0] => audio1.mp3 [1] => audio11.mp3 [2] => audio16.mp3 [3] => audio21.mp3 [4] => audio81.mp3 )

 

53. next :-

It is used to return the next component of an array.

<?php
$menu_list = array("Hachis Parmentier", "Raclette", "Chicken Marengo", "Jambon-beurre");
echo next($menu_list);
?>

Output
Raclette

54. pos :-

It returns the current element in an array.

<?php
$country = array("India", "America", "Germany", "Italy");
echo pos($country) . "<br>";
?>

Output
India

 

55. prev :-

It is used to return the previous (earlier) component of an array.

<?php
$country = array("Indonesia", "India", "Iceland", "Iran");

echo current($country) . "<br>";
echo next($country) . "<br>";
echo prev($country);
?>

Output
Indonesia
India
Indonesia

 

56. range :-

It is used to build an array from the given length.

<?php
$number = range(100,108);
print_r ($number);
?>

Output
Array ( [0] => 100 [1] => 101 [2] => 102 [3] => 103 [4] => 104 [5] => 105 [6] => 106 [7] => 107 [8] => 108 )

 

57. reset :-

It is used to reset the array from the private pointer to the first component in the array.

<?php
$country = array("Bhutan", "India", "Germany", "Kenya");

echo current($country) . "<br>";
echo next($country) . "<br>";

echo reset($country);
?>

Output
Bhutan
India
Bhutan

 

58. rsort :-

It is used to arrange the array in reverse alphabetical order.

<?php
$country=array("Bhutan","India","Germany","Kenya");
rsort($country);
$clength=count($country);
for($x=0;$x<$clength;$x++)
  {
  echo $country[$x];
  echo "<br>";
  }
?>

Output
Kenya
India
Germany
Bhutan

 

59. shuffle :-

It is used to shuffle the components in the array.

<?php
$name = array("Raj","kiran","Priya","John","Dick");

shuffle($name);
print_r($name);
?>

Output
Array ( [0] => kiran [1] => John [2] => Dick [3] => Priya [4] => Raj )

 

60. sizeof :-

It is used to return the number of components in an array.

<?php
$num=array("353","289","900","678");
echo sizeof($num);
?>

Output
4

 

61. sort :-

It is used to arrange the array in alphabetical ascending order.

<?php
$country=array("India","Australia","Germany","Kenya");
sort($country);

$clength=count($country);
for($x=0;$x<$clength;$x++)
  {
  echo $country[$x];
  echo "<br>";
  }
?>

Output
Australia
Germany
India
Kenya

 

62. uasort :-

It is used to arrange  the array by using a user-define function or comparison function and maintain the index.

<?php
function my_sort($a,$b)
{
if ($a==$b) return 0;
  return ($a<$b)?-1:1;
}

$country=array("a"=>"India","b"=>"Kenya","c"=>"Australia","d"=>"Germany");
uasort($country,"my_sort");
 
foreach($country as $x=>$x_value)
   {
   echo "Key=" . $x . ", Value=" . $x_value;
   echo "<br>";
   }
?>

Output
Key=c, Value=Australia
Key=d, Value=Germany
Key=a, Value=India
Key=b, Value=Kenya

 

63. uksort :-

It is used to arrange the array keys by using a user- define function.

<?php
function my_sort($a,$b)
{
if ($a==$b) return 0;
  return ($a<$b)?-1:1;
}

$country=array("a"=>"India","b"=>"Kenya","c"=>"Australia","d"=>"Germany");
uksort ($country,"my_sort");
 
foreach($country as $x=>$x_value)
   {
   echo "Key=" . $x . ", Value=" . $x_value;
   echo "<br>";
   }
?>

Output
Key=a, Value=India
Key=b, Value=Kenya
Key=c, Value=Australia
Key=d, Value=Germany

 

64. usort :-

It is used to arrange the array value by using a user-define function.

<?php
function my_sort($a,$b)
{
if ($a==$b) return 0;
  return ($a<$b)?-1:1;
}

$country=array("a"=>"India","b"=>"Kenya","c"=>"Australia","d"=>"Germany");
usort  ($country,"my_sort");
 
foreach($country as $x=>$x_value)
   {
   echo "Key=" . $x . ", Value=" . $x_value;
   echo "<br>";
   }
?>

Output
Key=0, Value=Australia
Key=1, Value=Germany
Key=2, Value=India
Key=3, Value=Kenya

 

 

 

 

 

Keywords: