(Very useful when querying DB).
If I have a multy dim array
[['id'=>1],['id'=>2],['id'=>34],['id'=>67]]
and what I want is [1,2,34,67]
I know how to do it in code, just asking if there is a built in way in PHP (or may be in PDO) to do this.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I think you need
PDO::FETCH_COLUMNmode infetchAll, which returns only a single column as array:From the manual: