3 ms·
I can see array_column being useful instead of using foreach on sql query results.
by conradfr 13y ago
I can see array_column being useful instead of using foreach on sql query results.
- dexen 13y ago...or PDOStatement->fetchColumn('column-name').
- ihsw 13y agoPDOStatement->fetchColumn() accepts only integers as an argument. http://ca.php.net/manual/en/pdostatement.fetchcolumn.php http://ca.php.net/manual/en/pdostatement.fetchcolumn.php
- conradfr 13y agoIt does not do the same thing, does it ? http://benramsey.com/blog/2013/03/introducing-array-column-in-php-5-dot-5/ http://benramsey.com/blog/2013/03/introducing-array-column-i...
- scribu 13y agoIt's useful for a whole bunch of things! I had it implemented in userland as a utility for years.
- desas 13y agoIt's useful for lots of things, I implemented something similar as array_pluck recently and immediately noticed lots of places where it could have been used.