Mat*_*ith 3 php simple-html-dom
该simple_html_dom库非常适合获取已知属性,但是有没有办法获取元素的所有属性列表?
例如,如果我有:
<div id="test" custom1="custom" custom2="custom">
Run Code Online (Sandbox Code Playgroud)
我很容易得到id:
$el = $html->find('div');
$id = $el->id;
Run Code Online (Sandbox Code Playgroud)
但是,它是否有可能获得custom1,custom2如果他们提前不知道?理想情况下,该解决方案将产生的阵列NVP的所有属性(id,custom1,custom2).
| 归档时间: |
|
| 查看次数: |
3721 次 |
| 最近记录: |