Is there any way to get all values in one array without using foreach loops, in this example?
<?php
$foo = array(["type"=>"a"], ["type"=>"b"], ["type"=>"c"]);
The output I need is array("a", "b", "c")
I could accomplish it using something like this
$stack = [];
foreach($foo as $value){
$stack[] = $value["type"];
}
var_dump($stack);
But, I am looking for options that does not involve using foreach loops.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…