Home  >  Article  >  Backend Development  >  PHP代码优化有关问题

PHP代码优化有关问题

WBOY
WBOYOriginal
2016-06-13 10:23:28820browse

PHP代码优化问题
a.php
$title='3月5号开始会';
$classid='1';
$a='a';
$b='b';
$c='c';
$d='d';
?>

b.php
if (file_exists('a.php')) {
include('a.php');
$filesname= '文本文件.txt';
$txt = file($filesname);
foreach($txt as $row) {
  $text = $text.$row.'
';}
$footer=file_get_contents('footer.html');

switch ( $classid )
{
case '1' :
$classname = '东区';
break;
case '2' :
$classname = '南区';
break;
case '3' :
$classname = '西区';
break;
case '4' :
$classname = '北区';
break;
default:
$classname = '其他';
};
}else {
Header( "HTTP/1.1 301 Moved Permanently" );  
Header( "Location: /error.html" );
};
?>




<?php echo $title;?>













鎬庝箞浼樺寲PHP浠g爜璁╂祻瑙堥€熷害鏇村揩鍛
Statement:
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