Level 10.8 PHP Aufgabenbuch

Задание 1

Schreiben Sie Code, der die Komplexität des Passworts überprüft. Denken Sie sich die Komplexitätskriterien selbst aus.

Задание 2

Gegeben ist ein Array. Geben Sie alle Variationen der Permutationen der Elemente dieses Arrays auf dem Bildschirm aus.

Задание 3

Gegeben ist ein Formular mit zwei Inputs. Beim Absenden des Formulars geben Sie eine ul-Liste aller befreundeter Zahlen aus dem Intervall aus, das durch die Werte der Inputs festgelegt ist.

Задание 4

Angenommen, in einer Datei wird ein JSON von Städten im folgenden Format gespeichert:

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

Angenommen, in einer Datei wird ein JSON von Ländern im folgenden Format gespeichert:

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

Schreiben Sie ein Skript, das die Länder durch ihre id ersetzt:

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