>  기사  >  백엔드 개발  >  PHP代码优化有关问题

PHP代码优化有关问题

WBOY
WBOY원래의
2016-06-13 10:23:28821검색

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爜璁╂祻瑙堥€熷害鏇村揩鍛
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.