troubleshooting Question

PHP fwrite Question

Avatar of mouimet
mouimet asked on
PHPWeb Development Software
2 Comments2 Solutions1797 ViewsLast Modified:
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
Michael701

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros