I'm trying to use preg_replace to remove commented code in some css styling that's coming through php from a database. If it's better to use srt_replace or some other function please let me know how to do it.
I want to delete the commented code in:
/*here is some commented code*/
background: #AAA;
/*here is some commented code*/
My string of the above code is in $spiderman:
$ironman = preg_replace("//*(.*?)/*/Uis","",$spiderman);
How can I get $ironman to be just
background: #AAA;
Thanks for you help.