覆盖基本 php 函数

发布于 2024-09-29 13:14:22 字数 168 浏览 0 评论 0原文

我在 php 中制作了一个类似于 print_r 函数的函数。

有没有一种方法可以添加到 php 的基本函数中,以便您服务器上的任何站点都可以使用您的新函数。

基本上我已经制作了一个带有标题的 print r 将会话保存到文件中以进行调试。

有谁知道这是否可能。 谢谢 :)

I have made a function simular to the print_r function in php.

Is there a way that you can add to the base functions of php so any sites that are on your server can use your new function.

basically i have made a print r with a header to save the sessions to a file for debugging .

does any one know if this is possible.
Thank you :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

番薯 2024-10-06 13:14:22

查看核心php.ini指令 auto_prepend_file

它的作用是自动添加一个require(yourscript.php) 每个 PHP 脚本。只需将您的函数放入其中,服务器上的所有 PHP 脚本(使用 php.ini)都可以使用它。

Check out the core php.ini directive auto_prepend_file

It's effect is that of automatically adding a require(yourscript.php) to every PHP script. Just throw your function in there and it's available to all PHP scripts on the server (that use that php.ini).

清音悠歌 2024-10-06 13:14:22

您可以将函数添加为 PEAR 扩展并将其放入本地 PEAR 存储库中。

向 PHP 核心添加函数

you can add your function as a PEAR extension and put it in a local PEAR repository.

Adding functions to PHP core

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文