If words can be printed before, but cannot be printed later

Source: Internet
Author: User
Tags exit in
If statements can be printed before, but cannot be printed later. & nbsp; foreach ($ sale_row & nbsp; as & nbsp; $ key = & gt; $ value) {& nbsp; & nbsp; $ sales_id [] = $ sal if statement can be printed before, but cannot be printed later
Foreach ($ sale_row as $ key => $ value ){
$ Sales_id [] = $ sale_row [$ key] ['sales _ id'];
}

// Print_r ($ sales_id); exit;
// No ongoing activities
If (empty ($ sale_row )){
Echo message_and_redirect ('alert ',' no promotions currently! ',-1 );
Exit;
}
Print_r ($ sales_id); exit;

I want to ask if the first red word can be printed.
However, the second red text cannot be printed, and the page is blank. I don't know where the intermediate sentence if is wrong,
When the background shows that all activities are past due time, alert prompts that there are no promotions currently and returns them. No error.
Why not?
New users post, please help
------ Solution --------------------
Print before if
print_r($sale_row);

------ Solution --------------------
// Print_r ($ sales_id); exit;
// No ongoing activities
If (empty ($ sale_row )){
Echo message_and_redirect ('alert ',' no promotions currently! ',-1 );
Exit;
}
Print_r ($ sales_id); exit;

There is an exit in your IF; ah, of course there will be no printing after executing this.
------ Solution --------------------
I can't see the problem from the clip you captured.

Where something went wrong, you just didn't post it.

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.