这就是我所拥有的:
$sep = "\t"; //tabbed character
$fp = fopen('registrars.xls', "w");
$schema_insert_rows = "";
//printing column names
$schema_insert_rows.="#" . $sep;
$schema_insert_rows.="Registrar" . $sep;
$schema_insert_rows.="Country" . $sep;
$schema_insert_rows.="Website" . $sep;
//$schema_insert_rows.="Postal Address" . $sep;
//$schema_insert_rows.="Contact Number" . $sep;
$schema_insert_rows.="Email Address" . $sep;
$schema_insert_rows.="\n";
fwrite($fp, $schema_insert_rows);
// printing data:
$row = 0; $i = 0; $schema_insert_rows = "";
$schema_insert_rows .= (++$row) . "" . $sep;
$schema_insert_rows .= $registrarArr[$i] . "" . $sep;
$schema_insert_rows .= $registrarArr[$i+1] . "" . $sep;
$schema_insert_rows .= $linkArr[$i] . "" . $sep;
$schema_insert_rows .= (string)(strip_tags($address)) . "" . $sep;
$schema_insert_rows .= (string)(strip_tags($phone)). "" . $sep;
$schema_insert_rows .= "email test";
$schema_insert_rows .= "\n";
fwrite($fp, $schema_insert_rows);
fclose($fp);
另一列工作正常,但我注释掉的那些不起作用[用于邮政地址和电子邮件地址]。我删除了评论,数据将转到下一行,尽管它应该与其他.. 我通过 var_dump 检查是否有 <br> 但没有.. 这里有什么问题?