Niveau 10.8 i PHP-opgavebogen
Skriv kode, der vil kontrollere styrken af en adgangskode. Find selv på kriterier for kompleksitet.
Der gives et array. Vis på skærmen alle varianter af permutationer af elementerne i dette array.
Der gives en form med to inputfelter.
Ved indsendelse af formularen, skal du vise
en liste med en ul over alle venlige tal
fra intervallet defineret af
inputfelternes værdier.
Antag at en fil indeholder JSON over byer af følgende struktur:
{
[
"id": "1",
"city": "city1",
"country": "country1",
],
[
"id": "2",
"city": "city2",
"country": "country1",
],
[
"id": "3",
"city": "city3",
"country": "country2",
]
}
Antag at en fil indeholder JSON over lande af følgende struktur:
{
[
"id": "1",
"country": "country1",
],
[
"id": "2",
"country": "country2",
],
[
"id": "3",
"country": "country3",
]
}
Skriv et script, som erstatter
landene med deres id:
{
[
"id": "1",
"city": "city1",
"country_id": "1",
],
[
"id": "2",
"city": "city2",
"country_id": "1",
],
[
"id": "3",
"city": "city3",
"country_id": "2",
]
}