1

I have an array that stores the name of the countries in Persian and English, like this:

$countries = array(
    array("id"=>1,"fa"=>"اتریش","en"=>"Austria"),
    array("id"=>2,"fa"=>"اتیوپی","en"=>"Ethiopia"),
    array("id"=>3,"fa"=>"اردن","en"=>"Jordan")
);

I want to have the Persian version of a country using the English one. For example:

$Eng = 'Jordan';
$Fa = requiredFunction($Eng);
echo $Fa;
//output should be: اردن

How do I achieve this?

Amin Darvand
  • 367
  • 2
  • 19

0 Answers0