热搜:NVER node 开发 php

报错syntax error, unexpected $end,请问什么原因

2024-09-12 11:40:01
报错syntax error, unexpected $end,请问什么原因

download
Please enter the need to look at the record of the last few days:
<?PHP include("conn.php"); if(isset($_POST['text'])) { $text=$_POST['text']; $t = date('Ymd', strtotime("-$text 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; }} } 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++){ ?> <?PHP } ?>
warehouse_mix warehouse_mix_label_pdf mix_pdf_address_label mix_pdf_address_label_A4
"><?PHP echo substr($hk_label[$i], 8, 24); ?>


报错请问什么原因???
Parse error: syntax error, unexpected $end in E:\APMServ5.2.6\www\htdocs\amazon\download_all.php on line 133


回复讨论(解决方案)

看似括号匹配错了,看了看,没找到

报错的原因就是最后少加了一个 }
加上就好了

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;
  }
}