How PHP writes the value of an array within the parentheses of the array ()

Source: Internet
Author: User
It's like this. One of my pages shows all the categories I want to hide some categories from not showing
I used the following code, but there's a place where I can't get any trouble.
if (! In_array ($term->slug, Array ())) {
$new _terms[] = $term;
}
I used this program to make some categories not show for example, I don't want to show the classification of slug value A as an array (' a ') you can
But I don't want to show a lot of things that need to be filtered from the database table.
$SHAIXUANKUWP _terms=mysql_query ("select * from ' wp_terms ' where term_id= '". $duqu _term_id. "");
This paragraph I screened out all the rows in the table I want to not show the classification
while ($DUQUSHUJUKUWP _terms=mysql_fetch_array ($SHAIXUANKUWP _terms)) {$duqu _slug= $duqushujukuwp _terms[slug];}
This paragraph of my line read out the classification of the Slug
It seems that the slug value read out every time will be replaced by a new read I'm not going to put the value in an array.
And it seems that array () can not be put in arrays only one
But I don't know how to put $duqu_slug this all in the above array ()
Could you help me see how to change it?
I'm a novice. Please explain it in more detail. Thank you, great God.


Reply to discussion (solution)

$duqu _slug[]= $DUQUSHUJUKUWP _terms[slug];

So the $duqu_slug is an array. Note Before initialization: $duqu _slug = Array ();

if (! In_array ($term->slug, $duqu _slug)) {
$new _terms[] = $term;
}

$duqu _slug[]= $DUQUSHUJUKUWP _terms[slug];

So the $duqu_slug is an array. Note Before initialization: $duqu _slug = Array ();

if (! In_array ($term->slug, $duqu _slug)) {
$new _terms[] = $term;
}

Thank you.

  • 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.