Is there a way to remove contents (substring) of a text file in PHP.
I know the start and the end of the string to remove, but not everything in between the content
File (routes.php) I want to edit
I want to keep this text here
# [[[@-100] I also want to remove the comment line here
I want to remove this text here
# I also want to remove this line [@-100]]]
I want to keep this line too
So I want to remove the content block that starts with # [[[@-100]
and ends with [@-100]]]
Im using codeignighter so I write my file like so
$ROUTE_FILE ='system/routes.php'
$output = file_get_contents($ROUTE_FILE);
$output = $output->remove_substring(...);
$this->write_file($ROUTE_FILE, $output);