PHP trigger_error函数在页面完成之前抛出错误.可以延迟它吗?或者让它在函数内部运行


PHP trigger_error function throws error before the page complete. Can it possible to delay it. or make to run inside a function?

我正在尝试使用PHP trigger_error()显示警告和通知。但它会在标题上方显示结果。我的意思是它在尸体标签后面打印。有没有可能在页面完全加载后执行它,或者让它在特定的分区内呈现。

我无法显示我的错误截图,所以这里有一个链接来获取我的错误图像。

if (isset($_GET['AddedID'])) {
$order_no = $_GET['AddedID'];
trigger_error(sprintf( _("Order # %d has been entered."),$order_no), E_USER_NOTICE);  }

此处diaplay_notification将调用

试试这个,把trigger_error()放在div中,告诉我它是否适合你。

<html>
<body>
    <div style="border:solid red 1px; width:500px">SOME TEXT HERE</div>
    <?php
        echo '<div style="border:solid red 1px; width:500px">';
        trigger_error("A NICE ERROR MESSAGE");
        echo '</div>';
    ?>
</body>
</html>