Help with a find and replace operation

Discussion in 'PHP' started by blueparukia, Dec 7, 2007.

  1. #1
    Ok, so I have a few CSS files.

    In them, it contains (among other things):

    
    .class
    {
    a few values;
    }
    
    Code (markup):
    Now, the values are always different, but what I basically want to do is comment it out, so it becomes

    
    /* .class
    {
    a few values;
    }*/
    
    Code (markup):
    I will also need to be able to undo the changes, so remove the comments with another function. I know I have to fopen, and probably some regex :(


    Cheers,

    BP
     
    blueparukia, Dec 7, 2007 IP