php函数中出现exit(),php – 无法在exit()内调用函数

在commons.php中定义了一个函数

desktop.php -> include commons.php

|

|

\|/

include MODULES.'mod.php'

我可以在任何我想要的地方调用我的自定义函数,但不能在if内部的出口内调用.调用函数的代码不会出现:

Mod.php:

....

$error = mysql_error();

if($_ADM['id_user']==1) {

if(!empty($error)) {

$debug = array(

'message' => "SQL Error in infography_edit module.",

'line' => '79',

'error' => $error,

'SQL' => $SQL

);

//exit(myPrint($debug)); //Calling here myPrint does not work

exit(print_r($debug)); //This works

}

}

$test = array('alex');

exit(myPrint($debug)); //Calling here myPrint works

....

// The output error: Call to undefined function myPrint()

我只是无法理解为什么上面的代码之外的任何其他地方工作,但不在其中而不在里面再次定义它

UPDATE

这样做,似乎也不起作用:

myPrint($debug);

exit();

// The output error: Call to undefined function myPrint()

UPDATE2

desktop.php主文件:

> require(LIBS.’commons.php’);

>常见的HTML

>包含模块

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值