Re: File problem!! HELP PLEASE
| From: | Christian Dechery | Date: | Wed, 13 Dec 2000 01:51:45 +0000 |
| Subject: | Re: File problem!! HELP PLEASE | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30000@lists.php.net to get a copy of this message | ||
At 23:02 12/12/00 +0000, you wrote:
No I am a newbie. Fputs I take it is an equivilant to fwrite? Can you elaboratein a way yes... but fwrite is more specific to be working on binary files... because it spits out since you're going with text fputs() is the best way... are u familiar with C? fputs stands for f(file... meaning stream)put(duh)s(string)... is meant only for printing strings into textfiles... if you have a scracth file with nothing on it... like: $file=fopen("/whatever/example.txt","wt"); and u have $str1= "whatever"; $str2 = "you want"; $str3 = "here"; and u do... fputs($file,$str1); <-- look... I left out the 3rd parameter (string lenght) [*] fputs($file,$str2); fputs($file,$str3); your file will look exacly like this: whatever you want here [*] if I'd placed the 3rd parameter there like: fputs($file,$str1,2) you'd have: wh ... hope it helped... ____________________________ . Christian Dechery (lemming) . http://www.tanamesa.com.br . Gaita-L Owner / Web Developer