Ec (2); convert each line of an html table into an array in csv format & lt ;? Functionget_tr_array ($ table) {php tutorial source code $ tablepreg_replace (& quot; & lt; td [^ & gt;] *? & Gt; si & quot;, & quot;, $ table); $ tablestr_replace (& quot; & lt; td & gt; & script ec (2 ); script
// Convert each line of the html table into an array in csv format
Function get_tr_array ($ table ){
// Php tutorial source code
$ Table = preg_replace ("' ] *?> 'Si ", '"', $ table );
$ Table = str_replace ("", '",', $ Table );
$ Table = str_replace (""," {Tr} ", $ table); // open-source osphp.com.cn
// Remove the html Tag
$ Table = preg_replace ("'<[/!] *? [^ <>] *?> 'Si "," ", $ table );
// Remove the white space characters
$ Table = preg_replace ("'([rn]) [s] +'", "", $ table );
$ Table = str_replace ("", "", $ table );
$ Table = str_replace ("", "", $ table );
$ Table = explode (", {tr}", $ table );
Array_pop ($ table );
Return $ table;
}
?>
// Convert each row and column of an html table into an array to collect table data
Function get_td_array ($ table ){
$ Table = preg_replace ("' ] *?> 'Si "," ", $ table );
// Osphp.com.cn
$ Table = preg_replace ("' ] *?> 'Si "," ", $ table );
$ Table = preg_replace ("' ] *?> 'Si "," ", $ table );
$ Table = str_replace (""," {Tr} ", $ table); // open-source osphp.com.cn
$ Table = str_replace (""," {Td} ", $ table );
// Remove the html Tag
$ Table = preg_replace ("'<[/!] *? [^ <>] *?> 'Si "," ", $ table); // osphp.com.cn Open Source
// Remove the white space characters
$ Table = preg_replace ("'([rn]) [s] +'", "", $ table );
$ Table = str_replace ("", "", $ table );
$ Table = str_replace ("", "", $ table );
$ Table = explode ('{tr}', $ table );
Array_pop ($ table); // php open source code
Foreach ($ table as $ key => $ tr ){
$ Td = explode ('{td}', $ tr );
Array_pop ($ td );
$ Td_array [] = $ td ;//}
Return $ td_array;
}
?>