Heim > Backend-Entwicklung > PHP-Tutorial > 报错syntax error, unexpected $end,请问什么原因

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

WBOY
Freigeben: 2016-06-23 14:10:03
Original
1231 Leute haben es durchsucht

<!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>
Nach dem Login kopieren


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

Quelle:php.cn
Erklärung dieser Website
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage