Rumah > pembangunan bahagian belakang > tutorial php > 报错syntax error, unexpected $end,请问什么原因

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

WBOY
Lepaskan: 2016-06-23 14:10:03
asal
1231 orang telah melayarinya

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>download</title></head><body><table width="1829" border="0" cellspacing="0">  <tr>    <td width="1827" height="79"><table width="100%" border="0" cellspacing="0">      <tr>        <td> </td>      </tr>	        <tr>        <td height="26"> <form id="form1" name="form1" method="post" action="download_all.php">Please enter the need to look at the record of the last few days:                           <input name="text" type="text" size="5" />            <input name="search" type="submit" value="Search" />          </form>          </td>      </tr>      <tr>        <td height="34"> </td>      </tr>    </table></td>    <tr></tr>    <td height="244" valign="top">			<table width="1827" border="0" cellspacing="1" bgcolor="#999999">      <tr>        <td width="105" height="20" bgcolor="#EEEEEE">warehouse_mix</td>        <td width="160" bgcolor="#EEEEEE">warehouse_mix_label_pdf</td>        <td width="151" bgcolor="#EEEEEE">mix_pdf_address_label</td>        <td width="167" bgcolor="#EEEEEE">mix_pdf_address_label_A4</td>        <td width="53" bgcolor="#EEEEEE"> </td>        <td width="50" bgcolor="#EEEEEE"> </td>        <td width="53" bgcolor="#EEEEEE"> </td>        <td width="66" bgcolor="#EEEEEE"> </td>        <td width="151" bgcolor="#EEEEEE"> </td>        <td width="127" bgcolor="#EEEEEE"> </td>        <td width="178" bgcolor="#EEEEEE"> </td>        <td width="223" bgcolor="#EEEEEE"> </td>        <td width="303" bgcolor="#EEEEEE"> </td>      </tr>		  			 <?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++){	  ?>				       <tr>         <td height="31" bgcolor="#FFFFFF"><a href="<?PHP echo $hk_label[$i]; ?>"><?PHP echo substr($hk_label[$i], 8, 24); ?></a></td>		 <td bgcolor="#FFFFFF"></td>	       <td bgcolor="#FFFFFF"></td>	       <td bgcolor="#FFFFFF"></td>	       <td bgcolor="#FFFFFF"> </td>	       <td bgcolor="#FFFFFF"> </td>	       <td bgcolor="#FFFFFF"> </td>	       <td bgcolor="#FFFFFF"> </td>	       <td bgcolor="#FFFFFF"> </td>	       <td bgcolor="#FFFFFF"> </td>	       <td bgcolor="#FFFFFF"> </td>	       <td bgcolor="#FFFFFF"> </td>	       <td bgcolor="#FFFFFF"> </td>      </tr>	<?PHP }  ?>	      <tr>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>        <td bgcolor="#FFFFFF"> </td>      </tr>    </table>			</td>  </tr>  <tr>    <td height="109"> </td>  </tr></table></body></html>
Salin selepas log masuk


报错请问什么原因???
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;
  }
}     
   

sumber:php.cn
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Tutorial Popular
Lagi>
Muat turun terkini
Lagi>
kesan web
Kod sumber laman web
Bahan laman web
Templat hujung hadapan