添加内容,如果下面没有错误数组
这是我的代码:
$msg = "Hello User {$uid}";
echo $msg;
$action = $_GET['do'];
if( file_exists("page/actions/{$action}.php") && !empty($action))
include_once("page/actions/{$action}.php");
else
include_once("page/actions/default.php");
现在我需要将其更改为:
如果包含页面:
include_once("page/actions/{$action}.php");
返回“错误”数组,则 $msg
变量将不会显示。
这可能吗?
This is my code:
$msg = "Hello User {$uid}";
echo $msg;
$action = $_GET['do'];
if( file_exists("page/actions/{$action}.php") && !empty($action))
include_once("page/actions/{$action}.php");
else
include_once("page/actions/default.php");
Now I need to change it into:
if included page :
include_once("page/actions/{$action}.php");
returned an 'error' array then $msg
variable won't be displayed.
Is that possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不太明白,但如果您在包含的文件中设置了错误数组,您可以使用
isset($errorArray)
检查。如果未设置,则回显该消息。I don't really understand but if you set an error array in your included file you can check with
isset($errorArray)
. And echo the message if not set.