Php filters multi-dimensional arrays. how can this problem be solved?

Source: Internet
Author: User
Php filters multidimensional Array (& nbsp; [0] & gt; Array (& nbsp; [isxinx] & gt; 1 & nbsp; [rate] & gt; 0.000 & nbsp; [qs] & gt; Issue 1 prediction & nbsp; [cb] & gt; 20 & nbsp; [title] & gt; [code to success] confidence prediction & nb php filter multi-dimensional array before lucky 3D177 trial No.
Array (
[0] => Array (
[Isxtasks] => 1
[Rate] = & gt; 0.000
[Qs] => Issue 1 prediction
[Cb] => 20
[Title] => [code to success] confidence prediction before the lucky 3D177 test number
[Id] = & gt; 4137166
[Userid] => 22843
[Childtype] => before the trial no.
[Mfarticleid] => 0
[Author] => code to success
[Pubtime] => 2012-07-23 14:18:30
[Cptypeid] => 2
[Jtpath] =>
[Num] => 2
[Ltitle] => Historical score
[Pm] = & gt; 10001)
[1] => Array (
[Isxtasks] => 1
[Rate] = & gt; 0.000
[Qs] => Issue 1 prediction
[Cb] => 20
[Title] => [code to success] confidence prediction before the lucky 3D177 test number
[Id] = & gt; 4137166
[Userid] => 22843
[Childtype] => before the trial no.
[Mfarticleid] => 0
[Author] => code to success
[Pubtime] => 2012-07-23 14:18:30
[Cptypeid] => 2
[Jtpath] =>
[Num] => 2
[Ltitle] => Historical score
[Pm] => 10001 ))

Now I want to obtain qs, cb, title, id, userid, author, ltitle
Data of these seven fields! How can I filter out other products?

------ Solution --------------------
Foreach ($ arr as $ v)
$ Ar [] = array ('Qs' => $ v ['Qs'],...);

Print_r ($ ar );
------ Solution --------------------
The reply is correct!
However, the data source may be retrieved from the data source. The best way is to set the field name when selecting, instead of using select *
SQL code
select qs,cb,title,id,userid,author,ltitle from table

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.