How to select only one column in an array
P粉410239819
2023-09-03 13:47:01
<p>I have an array like below in laravel and I want to extract the columns in it. </p>
<pre class="brush:php;toolbar:false;">Array
(
[0] => Array
(
[table] => form_identification
[column] => region
)
[1] => Array
(
[table] => form_identification
[column] => province
)
)</pre>
<p>I want the output to be as follows</p>
<pre class="brush:php;toolbar:false;">Array
(
[0] => Array
(
[column] => region
)
[1] => Array
(
[column] => province
)
)</pre></p>
Treat your first array as a
$datas
variable, we will use foreach to loop over the entire array