Answer the question
In order to leave comments, you need to log in
How to cut all blocks that do not contain an attribute?
The piece being tested
$test = '<input type="hidden" name="submitted" value="TRUE" />
<!-- LOCALE uk -->
<h2 class="">Required Information UK</h2>
<!-- /LOCALE -->
<!-- LOCALE uk --><h2 class="">Required Information UK</h2><!-- /LOCALE -->
<!-- LOCALE ru -->
<h2 class="">Required Information RU</h2>
<!-- /LOCALE -->
<!-- LOCALE -->
<h2 class="">Required Information EMPTY</h2>
<!-- /LOCALE -->
<div class="content_indent" style="width: 764px; margin-bottom: 35px;">';
//Попытки :(
echo preg_replace('#<!--\s+LOCALE\s+(ru)\s+-->.*?<!--\s+/LOCALE\s+-->#sm','',$test);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question