<?php
$array = [];
$a = ['itemListElement' =>
['@type' => 'ListItem', 'position' => '1', 'item' => ['name' => 'testName1']]];
$b = ['itemListElement' =>
['@type' => 'ListItem', 'position' => '2', 'item' => ['name' => 'testName2']]];
array_push($a, $b);
var_dump($a);
- Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
- array(2) {
["itemListElement"]=>
array(3) {
["@type"]=>
string(8) "ListItem"
["position"]=>
string(1) "1"
["item"]=>
array(1) {
["name"]=>
string(9) "testName1"
}
}
[0]=>
array(1) {
["itemListElement"]=>
array(3) {
["@type"]=>
string(8) "ListItem"
["position"]=>
string(1) "2"
["item"]=>
array(1) {
["name"]=>
string(9) "testName2"
}
}
}
}
preferences:
178.28 ms | 405 KiB | 292 Q