我有这个PHP脚本:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- pressed -->
<item android:color="@color/md_green_500" android:drawable="@drawable/btn_bg_pressed" android:state_pressed="true" />
<!-- focused -->
<item android:color="@color/md_red_500" android:drawable="@drawable/btn_bg_focused" android:state_focused="true" />
<!-- default -->
<item android:color="@color/md_blue_500" android:drawable="@drawable/btn_bg_default" />
</selector>
我收到此错误:
致命错误:无法在第64行的......中重新声明RecursiveCategories()(先前在:36中声明)
答案 0 :(得分:0)
您通过Include语句或其他文件包含了相同的函数定义,这就是您遇到此问题的原因。 使用以下内容:
if (!function_exists('RecursiveCategories')) { function RecursiveCategories($array) { //code goes here } }
建议:在lib文件中添加所有函数,并使用include_once命令包含lib.php文件。