Dex09 Posted January 12, 2009 Share Posted January 12, 2009 I have a 4000 line settings file (Settings.conf), and a form that allows users to change parts of the file, which they will later download. Well I got the form set up, and now I'm stumped. Needless to say... I'm a beginner. I tried using file_get_contents(), which is close to what I want, but it removes spaces and lines. I'm trying to get the contents of the entire file, and output the finished product (in text) to make sure the variables are being applied. ??? Quote Link to comment https://forums.phpfreaks.com/topic/140569-php-form/ Share on other sites More sharing options...
DeanWhitehouse Posted January 12, 2009 Share Posted January 12, 2009 dunno if it will work but <?php $file = file_get_contents("Settings.conf"); $file = nl2br($file); echo $file; ?> Quote Link to comment https://forums.phpfreaks.com/topic/140569-php-form/#findComment-735611 Share on other sites More sharing options...
Dex09 Posted January 15, 2009 Author Share Posted January 15, 2009 Thanks! Worked perfectly. Seems like I'm going to have to use a replace function though. Performance wise, is it okay to use str_replace() about 20 times in a row? Quote Link to comment https://forums.phpfreaks.com/topic/140569-php-form/#findComment-737548 Share on other sites More sharing options...
DeanWhitehouse Posted January 15, 2009 Share Posted January 15, 2009 Yeah maybe put it in a loop? Quote Link to comment https://forums.phpfreaks.com/topic/140569-php-form/#findComment-737855 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.