Niveau 9.8 van PHP taakboek
Gegeven een willekeurige tweedimensionale 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],
]
Verwissel twee opgegeven rijen:
[
[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],
]
Stel dat in een bestand JSON van landen van het volgende type is opgeslagen:
{
[
"id": "3",
"country": "country1",
],
[
"id": "7",
"country": "country2",
],
[
"id": "9",
"country": "country3",
]
}
Toon deze landen in de vorm van de volgende selectie:
<select>
<option value="3">country1</option>
<option value="7">country2</option>
<option value="9">country3</option>
</select>