jbwebdesign Posted April 26, 2009 Report Share Posted April 26, 2009 Hello, I have been trying to figure out a way to export a text file but I have no clue where to start. Can anyone please help me out?? Here is the basic coding for my script...... if(isset($loose)){ echo $prefix . $zero . "000" . " "; while($count<=8){ echo $prefix . "000" . ++$count . " "; } } everything is working fine, however what I want to do is be able to export this text to a text file by the name of $prefix-0000-0009 does any one have any ideas on how i can do this?? any help will be appreciated. Thanks Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted April 26, 2009 Report Share Posted April 26, 2009 check out this and this. Quote Link to comment Share on other sites More sharing options...
jbwebdesign Posted April 26, 2009 Author Report Share Posted April 26, 2009 Thanks so much....I have to read it and see what i can do Quote Link to comment Share on other sites More sharing options...
jbwebdesign Posted April 27, 2009 Author Report Share Posted April 27, 2009 Okay, I found out how to write a text file for anyone that needs it.....here is the code...... $myFile = "testFile.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "Floppy Jalopy\n"; fwrite($fh, $stringData); $stringData = "Pointy Pinto\n"; fwrite($fh, $stringData); fclose($fh); Quote Link to comment Share on other sites More sharing options...
jbwebdesign Posted April 27, 2009 Author Report Share Posted April 27, 2009 can anyone tell me how to put a in between the two Floppy Jalopy and Pointy Pinto??? Because the way it writes the file really sucks..... please help....thanks Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted April 27, 2009 Report Share Posted April 27, 2009 try "\r\n" instead of the "\n" Quote Link to comment Share on other sites More sharing options...
jbwebdesign Posted April 27, 2009 Author Report Share Posted April 27, 2009 thanks so much man! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.