当前位置:Gxlcms > PHP教程 > HTML表格的每行转为CSV格式数组

HTML表格的每行转为CSV格式数组

时间:2021-07-01 10:21:17 帮助过:23人阅读

",'",',$table);
  • $table = str_replace("
  • ","{tr}",$table); //开源代码OSPhP.COm.CN
  • //去掉 HTML 标记
  • $table = preg_replace("'<[/!]*?[^<>]*?>'si","",$table);
  • //去掉空白字符
  • $table = preg_replace("'([rn])[s]+'","",$table);
  • //开源代码OSPhP.COm.CN
  • $table = str_replace(" ","",$table);
  • $table = str_replace(" ","",$table);
  • $table = explode(",{tr}",$table);
  • //开源代码OSPHP.COM.Cn
  • array_pop($table);
  • return $table;
  • }
  • ?>
  • HTML表格的每行转为CSV格式数组
    1. //HTML表格的每行转为CSV格式数组
    2. function get_tr_array($table) {
    3. //PHP开源代码
    4. $table = preg_replace("']*?>'si",'"',$table);
    5. $table = str_replace("

    人气教程排行