I need to extract from this html:
<div class="list-group">
<a class="list-group-item active">
<h4 class="list-group-item-heading">{EVENT_GROUP_TIME}</h4>
</a>
{EVENTS:}
<a class="list-group-item">
<h4 class="list-group-item-heading">{EVENT_NAME}</h4>
<p class="list-group-item-text"><i>{EVENT_LECTURER}</i></p>
<p class="list-group-item-text">{EVENT_TIME}</p>
<p class="list-group-item-text">{EVENT_LOCATION}</p>
</a>
{ENDEVENTS}
</div>
Two substring: with {EVENTS:}...{ENDEVENTS}
block and second is everything else. In other words:
$group_header =
<div class="list-group">
<a class="list-group-item active">
<h4 class="list-group-item-heading">{EVENT_GROUP_TIME}</h4>
</a>
</div>
and $group_body =
<a class="list-group-item">
<h4 class="list-group-item-heading">{EVENT_NAME}</h4>
<p class="list-group-item-text"><i>{EVENT_LECTURER}</i></p>
<p class="list-group-item-text">{EVENT_TIME}</p>
<p class="list-group-item-text">{EVENT_LOCATION}</p>
</a>
I tried to make it with substr but it seems to be too slow with big date. Can someone suggest how to make such operation with regexp in php?