Just wondering if anyone has transformed a 2 dim array to a one dim array in php. I've yet to come across a clear explanation in php. Any suggestion would be appreciated.
This might be helpful to you if you fetching values from Query here you can use array function which will support in PHP 5.5+
$myfield_arr = array_column($query_result, 'myfield_name');
Say Good bye to loop! Enjoy Smart Code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With