Is it possible to replace part of text or HTML file with PHP? I’m loading portion of file into text editor by using preg_match to extract text only between certain tags. Now when finish editing I want to update the same file with changes made, and replace the same part previously loaded.
Share
since you’re using preg_match, you can use the preg_replace after editing and store it to the file.
for example if you are loading a UI for that then you might be doing this on file1.php
then on file2.php that receives the request on the form, you do exacly the same thing
these are just theoretical, kindly check with the php manual for correct syntax or parameters