在index.php中,我包含了來自文件(例如myfunc())和某個文件(myfile.php)的一些函數。 在file.php我試着使用這個功能。包含文件中的PHP函數範圍
未捕獲的錯誤:調用未定義的函數myFunc的...
示例代碼:
的index.php:
<?php
require_once "./myfunc.func.php";
require_once "./myfile.php";
myfunc.func.php:
<?php
function myfunc()
{
echo "myfunc test";
}
myfile.php:
<?php
myfunc();
而錯誤是? –
未捕獲的錯誤:調用未定義的函數...... – CoolONE
可能不包含文件'error_reporting(E_ALL); ini_set('display_errors','1');' – AbraCadaver