<table cellspacing="0" cellpadding="0"> <tr><td class="t_f" id="postmessage_17525"> HTML表格的每行转为CSV格式数组 <div class="blockcode"><div id="code_qVE"><ol> <li>//HTML表格的每行转为CSV格式数组 </li> <li> </li> <li>function get_tr_array($table) {</li> <li>//PHP开源代码</li> <li>$table = preg_replace("'<td>]*?>'si",'"',$table); <li>$table = str_replace("</li> </td>",'",',$table); </li> <li>$table = str_replace("</li> </ol></div></div> </td></tr>","{tr}",$table); //开源代码OSPhP.COm.CN <li>//去掉 HTML 标记 </li> <li>$table = preg_replace("']*?>'si","",$table); </li> <li>//去掉空白字符 </li> <li>$table = preg_replace("'([rn])[s]+'","",$table);</li> <li>//开源代码OSPhP.COm.CN</li> <li>$table = str_replace(" ","",$table); </li> <li>$table = str_replace(" ","",$table); </li> <li>$table = explode(",{tr}",$table);</li> <li>//开源代码OSPHP.COM.Cn</li> <li>array_pop($table); </li> <li> return $table; </li> <li>} </li> <li>?><em onclick="copycode($('code_qVE'));">复制代码</em> </li> </table> <div id="comment_17525" class="cm"> </div> <div id="post_rate_div_17525"></div> <br><br>