<?php
include_once("../include/common.php"); -----引入A文件
include_once("../include/moneychange.php");----引入B文件
echoName();-----B文件中的方法
?>问题出来了,现在在B文件中用到了A文件的变量,为什么提示找不到呢,谁能给个解决方法?
include_once("../include/common.php"); -----引入A文件
include_once("../include/moneychange.php");----引入B文件
echoName();-----B文件中的方法
?>问题出来了,现在在B文件中用到了A文件的变量,为什么提示找不到呢,谁能给个解决方法?
//---- A文件 -----$a=123; //A文件中的变量//---- A文件 -----function aa()
{
Global $a; //如果不把$a定义为global变量,函数体内是不能访问$a的
echo $a;
}
aa();