<?php
$events = [
[ 'categoryId' => 1, 'eventId' => 2, 'eventName' => 3, 'vendorName' => 4 ],
[ 'categoryId' => 5, 'eventId' => 6, 'eventName' => 7, 'vendorName' => 8 ],
[ 'categoryId' => 9, 'eventId' => 10, 'eventName' => 11, 'vendorName' => 12 ],
];
print_r(array_column($events, 'categoryId'));
- Output for 5.6.0 - 5.6.27, 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.6 - 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.31, 8.2.0 - 8.2.26, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
- Array
(
[0] => 1
[1] => 5
[2] => 9
)
preferences:
98.83 ms | 408 KiB | 5 Q