I would like to create an CSV file using php with an semicolon at the end of each line.
The file should looke like this:
Smith,"Andreas",";"
Smith,"John",";"
I can not get the semicolon at the end of the line. I tried all sorts of masking, read articels in the net but I just can't get it to work.
That is the code I use:
$datei1 = fopen($file1,"w");
$query = "SELECT * FROM customers ORDER BY cust_name";
$cust_name = $row['cust_name'];
$cust_firstname = $row['cust_firstname'];
$semicolon = ";";
$data = '"'.$cust_name.'","'.$cust_firstname.'","'.$semicolon.'"';
fwrite($datei1, $data);
fwrite($datei1, "\r\n");