PHP Taskbook Level 10.8

Задание 1

Write a code that will check the complexity of the password. Come up with the complexity criteria yourself.

Задание 2

Given an array. Display all possible permutations of the elements of this array.

Задание 3

Given a form with two inputs. When the form is submitted, output a list of ul all amicable numbers from the interval specified by the input values.

Задание 4

Let the file store JSON of cities of the following type:

cities.json{
  [
    "id": "1",
    "city": "city1",
    "country": "country1",
  ],
  [
    "id": "2",
    "city": "city2",
    "country": "country1",
  ],
  [
    "id": "3",
    "city": "city3",
    "country": "country2",
  ]
}

Let the file store JSON of countries in the following format:

countries.json{
  [
    "id": "1",
    "country": "country1",
  ],
  [
    "id": "2",
    "country": "country2",
  ],
  [
    "id": "3",
    "country": "country3",
  ]
}

Write a script that will substitute id countries instead of countries:

cities.json{
  [
    "id": "1",
    "city": "city1",
    "country_id": "1",
  ],
  [
    "id": "2",
    "city": "city2",
    "country_id": "1",
  ],
  [
    "id": "3",
    "city": "city3",
    "country_id": "2",
  ]
}