HTML to csv file in php
I would like to read a HTML file as and convert the table content inside the html to csv format file using php.
In general, in a directory HTML, i have a list of html files say
KMC_Doctors开发者_JAVA百科_list_A.html
KMC_Doctors_list_B.html
KMC_Doctors_list_C.html
....
KMC_Doctors_list_Z.html
I would like to read these HTML file and the write its table content to a CSV file.
Can any one help me in this regard.
Get ready for some reading: fputcsv will write in the csv format. But you need to understand regular expressions preg_match and preg_match_all will be very useful in the process. There's no quick way to turn html into csv.
精彩评论