douleng3463 2017-06-11 03:05
浏览 326
已采纳

解析错误:语法错误,意外“公共”(T_STRING),期待函数(T_FUNCTION)[重复]

This question already has an answer here:

Parse error: syntax error, unexpected ' public' (T_STRING), expecting function (T_FUNCTION) on line 4

<?php
// Redirect Page Function
class Redirect {
    public function __construct($url = null) { \\ this is line 4 
        if ($url)
        {
            echo '<script>location.href="'.$url.'";</script>';
        }
    }
}
?>
</div>
  • 写回答

1条回答 默认 最新

  • douchun5976 2017-06-11 03:11
    关注

    Please remove the comment and your code should work fine.

    This is what you should remove:

    \ this is line 4

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?