PHP Taskbook Level 9.10

Задание 1

Write code that will determine the maximum nesting level of a multidimensional array.

Задание 2

Given an arbitrary two-dimensional array:

php[
  [11, 32, 13, 44, 55],
  [31, 42, 53, 66, 75],
  [12, 26, 33, 45, 52],
  [15, 22, 35, 64, 57],
  [21, 52, 32, 44, 38],
]

Find the maximum and minimum elements and swap them.

Задание 3

Let the database store a table with countries of the following type:

table countries
id name

Let the database also store a table with cities of the following type:

cities table
id name country_id

Using the data from these tables, you will get an array of the following type:

php[
  'country1': [an array of cities in this country],
  'country2': [an array of cities in this country],
  'country3': [an array of cities in this country],
]