“Fatal error: Cannot redeclare

前端 未结 17 790
[愿得一人]
[愿得一人] 2020-11-22 05:26

I have a function(this is exactly how it appears, from the top of my file):



        
17条回答
  •  后悔当初
    2020-11-22 06:16

    This errors says your function is already defined ; which can mean :

    • you have the same function defined in two files
    • or you have the same function defined in two places in the same file
    • or the file in which your function is defined is included two times (so, it seems the function is defined two times)

    I think your facing problem at 3rd position the script including this file more than one time.So, you can solve it by using require_once instead of require or include_once instead of include for including your functions.php file -- so it cannot be included more than once.

提交回复
热议问题