3v4l.org

run code in 300+ PHP versions simultaneously
<?php $source = 'some css'; $source = explode('<!-- DEFAULT -->',$source); $return =(count($source)>1)?$source[1]:$source[0]; $ad_loop_regex = "/[\s\S]*\{%[\s]*for[\s]*ad[\s]*in[\s]*ads[\s]*%\}\s/"; $end_loop_regex = '/[\.\s\S]*\{%[\s\S]*endfor[\s\S]*%\}/'; if ($html==true&&preg_match($ad_loop_regex, $return)&&!$master) { $return = preg_replace($ad_loop_regex,'',$return); preg_match($end_loop_regex,$return,$temp_preg_arr); if (count($temp_preg_arr)>0) { $return = $temp_preg_arr[0]; $start_tag = strrpos($return,'{'); $return = substr($return,0,$start_tag); } } echo $return;

preferences:
44.79 ms | 402 KiB | 5 Q