本文介紹了將 html 表轉(zhuǎn)換為 php 數(shù)組的最快方法是什么?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
在最新版本的 php 中是否有專門設(shè)計用于幫助完成此任務(wù)的內(nèi)置函數(shù)?
are there build in functions in latest versions of php specially designed to aid in this task ?
推薦答案
使用 DOM 解析器,如 SimpleXML 將 HTML 代碼拆分為節(jié)點,并遍歷節(jié)點構(gòu)建數(shù)組.
Use a DOM parser like SimpleXML to split the HTML code into nodes, and walk through the nodes to build the array.
對于損壞/無效的 HTML,SimpleHTMLDOM 更寬松(但它不是內(nèi)置的).
For broken/invalid HTML, SimpleHTMLDOM is more lenient (but it's not built in).
這篇關(guān)于將 html 表轉(zhuǎn)換為 php 數(shù)組的最快方法是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!