Hi everyone! I'm back, asking for more help (I know that's what these forms are all about, but sometimes I feel bad asking anyway)...

So far, I have this code (with much of your help already):
PHP Code:

$searchThis ROOT_DIRECTORY.$pageSelected;
is_file($searchThis)) {
$searchThis file_get_contents($searchThis);
function findEditable() {
// Split Comments:
$split preg_split('/(<!-- OPEN .*? CLOSE -->)/i'$searchThis, -1PREG_SPLIT_DELIM_CAPTURE); 
$i=0$i count($split); $i++) { 
substr($split[$i], 09) == '<!-- OPEN') { 
$subSplit[] = preg_split('/<!-- OPEN id=\"(.*?)\" type=\"(.*?)\" -->(.*?)<!-- CLOSE -->/i'$split[$i], -1PREG_SPLIT_NO_EMPTY PREG_SPLIT_DELIM_CAPTURE); 
$i=0$i count($subSplit); $i++) { 
$returnCode[$i]['id'] = $subSplit[$i][0]; 
$returnCode[$i]['type'] = $subSplit[$i][1];    
$returnCode[$i]['code'] = $subSplit[$i][2];      
// goes on to write a form, allowing the user to edit each instance of $returnCode['code']

This code searches $searchThis for all instances of
<!-- OPEN id="any-id-here" type="specify-type-here" -->This is the content<!-- CLOSE --> and for each occurance, makes the content between the comments editable in a form. (Note that each instance will have its own id courtesy of $returnCode[$i]['id'] = $subSplit[$i][0];)

What I need to do now is save the changes of the form back to the file $searchThis, overwriting the old content between comments with the new content. The kicker is, I have to preserve any text that is *not* between comments. As I have explained in previous posts, I am not very good with RegEx (even though I'm getting a bit better), so I am somewhat lost in this process. All I know is that I'll likely have to use fopen(); and fwrite(); at some point...

I will provide all my code upon request, but I didn't want to overpost with potentially useless info unless I was sure it would be helpful. I know this may be alot to ask help for, so: Thanks for any help in advance!!!