Error syntaxerror, unexpected $ end. why?

Source: Internet
Author: User
Tags glob parse error
Error syntaxerror, unexpected $ end. why?
$t){ $hk_label[] = $hk_label_fn; }} } else { $t = date('Ymd', strtotime('-5 day'));$hk_label = array();foreach(glob('download/*_Warehouse_mix*.txt') as $hk_label_fn) { if(substr($hk_label_fn, 8, 8)>$t){ $hk_label[] = $hk_label_fn; { $hk_label[] = $hk_label_fn; }} }$jp_warehouse_count=count($jp_warehouse);$c=max($jp_label_count,$hk_label_count,$hk_warehouse_count,$jp_warehouse_count);for($i=0;$i<$c;$i++){ ?>
warehouse_mix warehouse_mix_label_pdf mix_pdf_address_label mix_pdf_address_label_A4                  

What is the cause of the error ???
Parse error: syntax error, unexpected $ end in E: \ APMServ5.2.6 \ www \ htdocs \ amazon \ download_all.php on line 133

Reply to discussion (solution)

It seems that the matching brackets are wrong. I looked at it and couldn't find it.

The cause of the error is that one is missing}
Just add

Foreach (glob ('Download/* _ Warehouse_mix *. txt ') as $ hk_label_fn ){
If (substr ($ hk_label_fn, 8, 8)> $ t) {$ hk_label [] = $ hk_label_fn;
$ Hk_label [] = $ hk_label_fn;

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