PHP: how to avoid redeclaring functions?

前端 未结 4 1809
-上瘾入骨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条回答
  •  攒了一身酷
    2020-12-16 10:22

    if(!function_exists("get_raw_data_list")) {
    ... define function here ...
    }
    

    http://us.php.net/function_exists

提交回复
热议问题