mouimet
asked on
PHP fwrite Question
I have a tab file I am trying to write however some of the fields are occasionally blank. The tabs work fine if I print to the screen but fwrite is treating it as empty. I am trying to make the header count match the field count so I need the tabs even if the field is empty.
Partial code:
$test1= "test";
$test2= "";
$test3 = "";
$upload_file = fopen($cwd.$tmp_filename, "w");
$file_contents=$test1."\t".$test2."\t".$test3;
fwrite($upload_file, $file_contents);
fclose($upload_file);
print_r($file_contents);
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.