How does php write an array value in the brackets of array ()?

Source: Internet
Author: User
How does php write an array value in the brackets of array ()? & nbsp; one of my pages shows all Types & nbsp; I want to hide some categories and do not display them. I used the following code & nbsp; but it is difficult to find out if it is possible; thanks to if & nbsp; php, how can I write an array value in the brackets of array ()?
Yes. on one of my pages, all categories are displayed. I want to hide some categories.
I used the following code, but there is something difficult to do. Please check if you will thank me.
If (! In_array ($ term-> slug, array ())){
$ New_terms [] = $ term;
}
I used this program to make some categories not displayed. for example, if I don't want to display A slug value as A classification, I can write it as array ('A ').
However, I do not want to display a lot of data that needs to be filtered out from the database table.
$ Shaixuankuwp_terms = mysql_query ("SELECT * FROM 'WP _ terms 'where term_id ='". $ duqu_term_id ."'");
In this section, I have filtered out all rows in the table that I want not to display the category.
While ($ duqushujukuwp_terms = mysql_fetch_array ($ shaixuankuwp_terms) {$ duqu_slug = $ duqushujukuwp_terms [slug];}
I read the slug of the classification in one row.
It seems that the slug value read in this way will be replaced by the new read every time. Should I put the value in an array?
In addition, it seems that the array () cannot be placed in one row.
But I don't know how to put $ duqu_slug in the above array ().
Please help me see how to change it. thank you.
I am a newbie. please try to explain it in detail. thank you for sharing it with us:
------ Solution --------------------
$ Duqu_slug [] = $ duqushujukuwp_terms [slug];

In this way, $ duqu_slug is an array. Note that before initialization: $ duqu_slug = array ();

If (! In_array ($ term-> slug, $ duqu_slug )){
$ New_terms [] = $ term;
}

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.