I use insert_with_markers in a couple of my plugins to add some small bits of code to the htaccess file. What I’m unclear about is how to remove the code and markers.
For example, if I call the function like this:-
insert_with_markers($htaccess, "marker","RewriteBase /foobar");
The result in htaccess is:-
# BEGIN marker
RewriteBase /foobar
# END marker
I can use insert_with_markers, with an empty string, like so:-
insert_with_markers($htaccess, "marker","");
Which removes all the code, but the markers remain, like this:-
# BEGIN marker
# END marker
Does anybody know of a clean way to remove the markers as well?… that doesn’t involve filtering the htaccess file with regex? I would like to be able to uninstall my plugins and remove all the traces if possible.