我的 php 变量就像
$boothsizetopges = "CHILDREN'S CLUB MARCH 2013
EHIBITING COLLECTION NAME: $company
BOOTH SIZE: $booth_size
";
$companyinfo = "
CONTACT INFORMATION
EXHIBITING COLLECTION NAME: $company
BOOTH NUMBER: $booth
CONTACT: $contact
BOOTH SIZE: $booth_size
CONTACT CELL: $contact_cell
CONTACT EMAIL: $email
STREET ADDRESS: $street
CITY, STATE, ZIP: $city ";
$message = $boothsizetopges . $companyinfo ;
我将 $message 写入 .txt 文件的代码是
$myFile = "exfiles/".str_replace(" ","-",$_POST['companyname'])."_".time().".txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $message;
fwrite($fh, $stringData);
fclose($fh);
在这里,我的问题是 .txt 文件输出在单行中打印而没有换行符。但是在邮件中,每一行中的数据都很好。
需要帮忙...