index.php 中出錯
<?php
//url 形式 index.php?controller=控制器名&method=方法名
require_once('function.php');
$controllerAllow=array('test','index');
$methodAllow=array('test' ,'index' ,'show');
$controller=in_array($_GET['controller'],$controllerAllow) ?daddslashes($_GET['controller']):'index';
$method=in_array($_GET['method'],$methodAllow) ? daddslashes($_GET['method']):'index';
C($controller,$method);
}?>
報錯顯示在第六行的daddslashes
Parse error: syntax error, unexpected '錛焏addslashes' (T_STRING) in?D:\WWW\mvc\index.php?on line?6怎么會是這個呢
2015-05-04
$controller= ... ?... :'index';
我猜這個問號是中文全角的字符。 刪掉?以及前后的空格,切換為英文輸入法重新輸入試試?
2015-05-04
發(fā)現(xiàn)了是下面多了一個大括號和?前后出現(xiàn)了空格
老師那個為什么我的結果出現(xiàn)了兩個hello world 和緩存有關還是?