I might have to add another variable to a config file. So I need a function that can read a php file as is. I tried another way and it could only read the html and the php would not show.
Many php sites have one config file holding all the variables. In order to update that file you would need to remove it and add a new one. Well, on a web script I am unsure what my users have entered, so I can not just enter a blank one. I need a way to read a raw php file, then be able to add a line at line 26 and then at 32 and so on.
The thing is that I might have to add a line or replace a line. Here in total is what I need my script to do, I am only asking for help how to get to this point and not someone to write it.
I am sure some of you have used easymod for phpbb sites. It is a zip file, that has a long file with a set of install rules, the site reads the rules and updates the site as needed.
Code: Select all
---------------------------------------------
# below: include('header.inc.php');
---------------------------------------------
include('config.inc.php');
---------------------------------------------
# above: $url = 'http://mysite.com';
---------------------------------------------
$site_title = 'mysite';
---------------------------------------------
# End
---------------------------------------------I have a good understanding of php, however have little experience in file work.