TheSky Posted May 20, 2011 Share Posted May 20, 2011 this is part of my code how should i make fwrite to get in txt file name,Level,CT,Kills,Deaths,killdeaths,AS values ? any help will be welcome $file="$name.txt"; $open=fopen($file,"a"); if($open){ fwrite($open,$name,$Level,$CT,$Kills,$Deaths,$killdeaths,$AS); fclose($open); } Quote Link to comment https://forums.phpfreaks.com/topic/236989-1-values-on-function/ Share on other sites More sharing options...
wildteen88 Posted May 20, 2011 Share Posted May 20, 2011 You most likely need to wrap $name,$Level,$CT,$Kills,$Deaths,$killdeaths,$AS within double quotes. You cannot pass multiple parameters to fwrite fwrite($open, "$name,$Level,$CT,$Kills,$Deaths,$killdeaths,$AS"); fwrite can only take three arguments, quoted from the manual. int fwrite ( resource $handle , string $string [, int $length ] ) Quote Link to comment https://forums.phpfreaks.com/topic/236989-1-values-on-function/#findComment-1218133 Share on other sites More sharing options...
TheSky Posted May 20, 2011 Author Share Posted May 20, 2011 thanks it worked fine only what i need now is that it saves every time in new line Quote Link to comment https://forums.phpfreaks.com/topic/236989-1-values-on-function/#findComment-1218138 Share on other sites More sharing options...
wildteen88 Posted May 20, 2011 Share Posted May 20, 2011 Add \n after $AS and before the " Quote Link to comment https://forums.phpfreaks.com/topic/236989-1-values-on-function/#findComment-1218140 Share on other sites More sharing options...
TheSky Posted May 20, 2011 Author Share Posted May 20, 2011 thanks allot Quote Link to comment https://forums.phpfreaks.com/topic/236989-1-values-on-function/#findComment-1218146 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.