2016-08-28 12:21
浏览 352


Apparently, in PHP, there are a few DOM selectors like getElementById and getElementsByTagName but not the class selector, getElementsByClassName that is in javaScript, but strangely, not in PHP. Now, I have made a project that has to use class selectors in order to locate the elements in that particular page's DOM, but nethertheless, considering there's no getElementsByClassName method in PHP; I can't complete my project correctly.

So, how is it possible to apply "get elements by class name" in the PHP Document Object Model(DOM)?

Any help would be appreciated!

图片转代码服务由CSDN问答提供 功能建议

显然,在PHP中,有一些 DOM选择器,如 getElementById < / code>和 getElementsByTagName 但不是 javaScript 中的类选择器 getElementsByClassName ,但奇怪的是 现在,我已经创建了一个必须使用类选择器的项目,以便在该特定页面的DOM中找到元素,但仍然是 ,考虑到PHP中没有 getElementsByClassName 方法; 我无法正确完成项目。

那么,如何在 PHP文档对象模型(DOM)中应用“按类名获取元素”? < / blockquote>


  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题