Filtering and splicing an array in Twig
问题 I have an array of user records (0 indexed, from a database query), each of which contains an array of fields (indexed by field name). For example: Array ( [0] => Array ( [name] => Fred [age] => 42 ) [1] => Array ( [name] => Alice [age] => 42 ) [2] => Array ( [name] => Eve [age] => 24 ) ) In my Twig template, I want to get all the users where the age field is 42 and then return the name field of those users as an array. I can then pass that array to join(<br>) to print one name per line. For