首頁  >  文章  >  後端開發  >  請問這段php的錯誤在哪?我沒找到錯啊

請問這段php的錯誤在哪?我沒找到錯啊

WBOY
WBOY原創
2016-09-05 08:44:521053瀏覽

這是在網路上找的smarty設定的段碼。

一開始提示
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in F:phpstudyWWWsmartysconfig.php on line 2
我看到第二行沒問題啊,於是自己從新敲了一遍,一抹一樣的,就好了。

然後提示
Parse error: syntax error, unexpected T_VARIABLE in F:phpstudyWWWsmartysconfig.php on line 4
這就很費解了,$tpl = new Smarty(); 這句話有錯嗎?

謝謝。

<code><?php  
  include "/smarty/libs/Smarty.class.php";  
  define(@#__SITE_ROOT@#, @#f:/phpstudy/WWW/smartys/smarty@#); // 最后没有斜线  
  $tpl = new Smarty();  
  $tpl->template_dir = __SITE_ROOT . "/templates/";  
  $tpl->compile_dir = __SITE_ROOT . "/templates_c/";  
  $tpl->config_dir = __SITE_ROOT . "/configs/";  
  $tpl->cache_dir = __SITE_ROOT . "/cache/";  
  $tpl->left_delimiter = @#<{@#;  
  $tpl->right_delimiter = @#}>@#;  
  ?></code>
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn