SimpleXMLElement PHP4
我知道 SimpleXMLElement 在 PHP4 中不起作用,但是是否有类似的东西可以替换它以使脚本在 PHP 4 中工作?
I know SimpleXMLElement doesn't work in PHP4, but is there a something similar I can replace it with to make the script work with PHP 4?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
也许Ister.org 的 simplexml44 - PHP5 SimpleXML 的 PHP4 反向移植 可能会帮助你.. 。
免责声明:我根本没用过它!
...但祝你好运:XML 支持是 PHP 5 中添加的“重要内容”之一...
PHP 4 中还有一些与 XML 相关的函数/类; 但没有什么看起来像 SimpleXML :-(
例如:
顺便说一句:您应该真的考虑切换到 PHP 5:不再支持 PHP 4,即使是与安全相关的错误!
您是否在支持 PHP5 的服务器上尝试过您的应用程序? 如果它有效,它可能允许您使用 SimpleXML ;-)
从 PHP 4 切换到 PHP 5 时出现一些问题; 但对于您的应用程序来说可能不会太多?
Maybe Ister.org's simplexml44 - PHP4 backport of PHP5 SimpleXML might help you...
Disclaimer : I've never used it at all !
... But I wish you luck : XML-support is one of the "big stuff" that was added in PHP 5...
There were also some XML-related functions/classes in PHP 4 ; but nothing looking like SimpleXML :-(
For instance :
BTW : you should really think about switching to PHP 5 : PHP 4 is not supported anymore, even for security-related bugs !
Did you try your application on a PHP5-enabled server ? If it works, it might allow you to use SimpleXML ;-)
There were some problems switching from PHP 4 to PHP 5 ; but maybe not too many for you application ?
PHP4 有 DOM XML 和基于事件的 sax 解析器。 两者都不是 SimpleXml 的直接替代品,如果我没记错的话,两者都不是标准的,这意味着您需要将它们安装/启用为扩展。 PHP5 上也存在 sax 解析器,因此如果您希望代码向前兼容,这可能是最安全的选择。
PHP4 had DOM XML and the event-based sax parser. Neither are drop-in replacements for SimpleXml and if I remember correctly, neither were standard, meaning that you need them installed/enabled as extensions. The sax parser also exists on PHP5, so if you want your code to be forward compatible, that is probably the safest bet.
PHP5 首次发布于 2004 年,而 PHP4 的生命周期几乎完全结束了一年前。 如果您当前的虚拟主机甚至不提供该选项,那么是时候升级...并切换虚拟主机了。
PHP5 saw its first release in 2004, and PHP4 end-of-lifed almost exactly a year ago. It's time to move up... and to switch webhosts if your current one doesn't even offer the option.