herghost Posted January 14, 2012 Share Posted January 14, 2012 Hi all I am having some issues basically $sftp->put("server.properties", "allow-nether=".$nether." level-name=".$lname.""); is not printing the variables. $sftp is part of the phpseclib and the fuction is in the same format as fwrite(), I have tried and failed using fwrite as well! I can echo out the 1st variable correctly, but as soon as I add the second I just get allow-nether= level-name= The variables $nether and $lname exist and I have echo'd them to check. I guess this is a formatting problem, just cant work it out! Quote Link to comment https://forums.phpfreaks.com/topic/255024-using-variables-when-creating-a-file/ Share on other sites More sharing options...
laffin Posted January 14, 2012 Share Posted January 14, 2012 remove the put functions and display it directly, once you got your output right add put. This looks like a continuation of the other post that retrieved values. for that I would opt for a reverse operation of the code posted there. $out=''; foreach($vars as $key=>$val) { $out.="$key=$val".PHP_EOL; } echo $out; if $out is what you want, then try using your ftp put function Quote Link to comment https://forums.phpfreaks.com/topic/255024-using-variables-when-creating-a-file/#findComment-1307640 Share on other sites More sharing options...
herghost Posted January 14, 2012 Author Share Posted January 14, 2012 These are no longer coming from an array, they are the post variables from a form, should have put it in the 1st post really Quote Link to comment https://forums.phpfreaks.com/topic/255024-using-variables-when-creating-a-file/#findComment-1307644 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.