编辑PHP页面...在PHP中

This is quite a complex question for what is a complex idea and project. I'm wondering if there is a way to edit certain lines of a PHP page through a PHP page? One page, lets say (index.php) would be for the public whilst another (edit.php) would be the page to edit certain things on this page. I'm looking for a way to update the data, not just replace the file.

The edit.php file would show what is currently there and allow the user to change it and the save it. Is this possible? I can already see replies saying "Why are you not using a Database?"... It's easier this way, I think? Any suggestions are appreciated.

My recommendation would be to create an object that represents the information they can edit and then use PHPs serialize and unserialize to map it to a string and back.

The string can be stored in a text file and PHP handles changes to the object very gracefully if you add new properties.

If you want them to actually change PHP code, it could be very volatile.