相关疑难解决方法(0)

Php包括不工作?功能不包括在内

以下是该情况的完整背景:

我最近有一台新Mac,我是一名php开发人员,所以我下载了MAMP并开始开发.

首先我注意到我的包含没有包括在内,但我通过配置我的更改了php.ini.

但是现在,当我尝试使用函数包含文件时,它无法识别该函数.

例如,我有一个名为的文件functions.php:

<?php
function doit(){
    echo "did it";
}
?>
Run Code Online (Sandbox Code Playgroud)

以及包含它的文件,名为index.php

<?php include("functions.php"); doit();?>
Run Code Online (Sandbox Code Playgroud)

我收到此错误消息

致命错误:在第4行的index.php中调用未定义的函数doit()

php function include-path

9
推荐指数
2
解决办法
8万
查看次数

标签 统计

function ×1

include-path ×1

php ×1