PHP Taskbook Level 9.8
Let the site page be accessed with one of the URLs, in which the user's language is specified:
http://test.com/ru/dir1/dir2/
http://test.com/en/dir1/dir2/
In response to such an appeal, provide the text in the appropriate language:
$arr = [
'ru' => 'text word version document book',
'en' => 'text',
];
Given an arbitrary two-dimensional array:
[
[11, 12, 13, 14, 15],
[21, 22, 23, 24, 25],
[31, 32, 33, 34, 35],
[41, 42, 43, 44, 45],
[51, 52, 53, 54, 55],
]
Swap the two given rows:
[
[51, 52, 53, 54, 55],
[21, 22, 23, 24, 25],
[31, 32, 33, 34, 35],
[41, 42, 43, 44, 45],
[11, 12, 13, 14, 15],
]
Let the file store JSON of countries in the following format:
{
[
"id": "3",
"country": "country1",
],
[
"id": "7",
"country": "country2",
],
[
"id": "9",
"country": "country3",
]
}
Output these countries as the following select:
<select>
<option value="3">country1</option>
<option value="7">country2</option>
<option value="9">country3</option>
</select>