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); } 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 ] ) 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 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 " 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 Link to comment https://forums.phpfreaks.com/topic/236989-1-values-on-function/#findComment-1218146 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.