<?php
$samples=array(
array('page' => 'page1', 'name' => 'pagename1'),
array('page' => 'page2', 'name' => 'pagename2'),
array('page' => 'page3', 'name' => 'pagename3')
);
$names = array_column($samples, 'name');
print_r($names);
- Output for 5.6.0, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14
- Array
(
[0] => pagename1
[1] => pagename2
[2] => pagename3
)
preferences:
53.9 ms | 407 KiB | 5 Q