I have a css file with this content:
#firstdiv { width:100%; height:200px; }
#seconddiv { width:80%; height:70px; }
#thirddiv { width:80%; height:70px; }
#firstdiv { color:red; background:yellow; }
#seconddiv { color:red; background:green; }
#firstdiv { border:3px solid black; border-rdius:5px; }
How can I remove all #firstdiv
css properties using php?
This is my desired output:
#seconddiv { width:80%; height:70px; }
#thirddiv { width:80%; height:70px; }
#seconddiv { color:red; background:green; }
The most easy way would to split the file based on newlines and then check for each row whether it starts with the string you don't want and finally save the file to the location.
In case there are multiple selectors on one line, you need to do this