【问题标题】:php - modify standard function [duplicate]php - 修改标准函数
【发布时间】:2012-02-10 17:04:36
【问题描述】:

可能重复:
Redefine Built in PHP Functions

我需要重写 php 的标准函数之一。在javascript中,我会这样做:

    <script type="text/javascript">
        window.alert = function(str) {
            document.write(str);
        }
        alert("hello");
    </script>

是否可以在php中做到这一点?

【问题讨论】:

标签: php


【解决方案1】:

使用Advanced PHP Debugger PECL 扩展名。请参阅override_function() 文档。

【讨论】:

    【解决方案2】:

    没有,有一个 PHP 模块可以做到这一点,但通常没有。

    override_function of the APD module

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-07
      • 2021-06-06
      • 2018-06-11
      相关资源
      最近更新 更多