Home > Backend Development > PHP Tutorial > 这为什么总是提示错误?

这为什么总是提示错误?

WBOY
Release: 2016-06-23 13:01:00
Original
905 people have browsed it

以前试还好好的  刚才试了一下报错了 这个文件名就是function.php 不知道为什么会报错?
引用这个文件的时候出的错误 在哪里引用这个文件都提示这个错误  真是奇怪啊  
   include 'function.php';
   fenye();
?>
( ! ) Parse error: syntax error, unexpected '{' in D:wampwwwfunction.php on line 2

<?php function fenye(){global $page,$pagenum,$shoupage,$pageoffset;echo "<div >";echo "<ul id='ul2'>";echo '<li>'.$page.'/'.$pagenum.'页|</li>';   if($page==1){             echo '<li>首页|</li>';             echo '<li>上一页|</li>';   }else{   	 echo '<li><a href="'.$_SERVER["SCRIPT_NAME"].'">首页</a>|</li>';             echo '<li><a href="'.$_SERVER["SCRIPT_NAME"].'?'.($page-1).'">上一页</a>|</li>';   }   $shoupage=5;       $pageoffset=($shoupage-1)/2;       $start=1;       $end=$pagenum;   if($pagenum>$shoupage){       	if($page>$pageoffset){       	$start=$page-$pageoffset;       	$end=$pagenum>$page+$pageoffset?$page+$pageoffset:$pagenum;       	}else{       	$start=1;       	$end=$pagenum>$shoupage?$shoupage:$pagenum;       	}       	if($page+$pageoffset>$pagenum){       	$start=$start-($page+$pageoffset-$end);       	}       }   echo '<div>';       echo '<ul id="ul1">';       for($i=$start;$i<=$end;$i++){       	echo '<li><a href="'.$_SERVER["SCRIPT_NAME"].'?page='.$i.'">'.($i).'</a></li>';       }       echo '</ul>';           echo '</div>';   if($page==$pagenum){   	echo '<li>|下一页|</li>';   	echo '<li>尾页|</li>';   }else{   	echo '<li>|<a href="'.$_SERVER["SCRIPT_NAME"].'?page='.($page+1).'">下一页</a>|</li>';   	echo '<li><a href="'.$_SERVER["SCRIPT_NAME"].'?page='.$pagenum.'">尾页</a>|</li>';   }  echo '</ul>';    echo '</div>';    }?>
Copy after login


回复讨论(解决方案)

关闭输入法,把出现错误的行重新敲一遍

通常来说include只出警告的。应该是你哪里错了 或者你从新打一遍。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template