我写了一个dql查询:
$emails = $manager->createQuery('SELECT (u.email) as email FROM App\Entity\User u')->getResult();
返回:
我想将其转换为一个简单的数组,该数组将直接列出电子邮件,例如:
$emails = ["email1", "email2", "email3", "email4" ...];
有人可以帮我吗?。
我写了一个dql查询:$ emails = $ manager-> createQuery('SELECT(u.email)as FROM APP \ Entity \ User u')-> getResult();返回:我想将其转换为一个简单的数组,谁'...
$emails = $manager->createQuery('SELECT (u.email) as email FROM App\Entity\User u')->getResult();
$emails = array_column($emails, 'email');