fork download
  1. <?php
  2.  
  3. $string = 'a<!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1;
  4. mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-
  5. ... -->b<!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1;
  6. mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-... -->';
  7. $string = preg_replace('/<!--.*?-->/s', '', $string);
  8. echo $string; // imprime: ab
Success #stdin #stdout 0s 82624KB
stdin
Standard input is empty
stdout
ab