PHP: how to avoid redeclaring functions?

前端 未结 4 1833
-上瘾入骨i
-上瘾入骨i 2020-12-16 09:33

I tend to get errors such as:

Fatal error: Cannot redeclare get_raw_data_list() (previously declared in /var/www/codes/handlers/make_a_thread/get_raw_

4条回答
  •  猫巷女王i
    2020-12-16 10:26

    "function_exists" will tell you if a function has already been declared. Though I suspect maybe you have a problem with including files more than once. When you include a file are you using require_once or include_once or just require / include?

提交回复
热议问题