3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $lt = '&lt;'; $gt = '&gt;'; $raw_data = '[if lte IE 8]&gt;&lt;link href=&quot;//d3h5jhobc20ump.cloudfront.net/f521cb9cec0171e8d913538552d98b10.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;&lt;![endif]'; echo htmlspecialchars(preg_replace('/^\\s*\\[\\s*(if)(\\s[^\\]]*?)?\\s*\\]'.$gt.'\\s*(.*?)\\s*'.$lt.'!\\[\\s*(endif)\\s*\\]\\s*$/si', '[$1$2]'.$gt."\r\n".'$3'."\r\n".$lt.'![$4]', $raw_data));
Output for 4.3.0 - 7.1.0
[if lte IE 8]&amp;gt; &amp;lt;link href=&amp;quot;//d3h5jhobc20ump.cloudfront.net/f521cb9cec0171e8d913538552d98b10.css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot;&amp;gt; &amp;lt;![endif]