V
V
viktorross2019-05-28 00:09:04
PHP
viktorross, 2019-05-28 00:09:04

How to fix php regular expression?

hello, help me correct the regular expression
there is such a code

if ($section) {
            $section = cleanStr($section);
            $section_cond = "and ( sections like '0' or sections REGEXP '\\[\\[:<:\\]\\]" . $section . "\\[\\[:>:\\]\\]' )";

Sample
{banner->getTemplateBanners p1='listings2' p2=$section p3=$cat p4=$bloc assign='array_banners'}

this code displays a banner between articles, more precisely divides the articles in half and displays between them,
please tell me how to make this same banner appear after 1 article or after 2, for example, I don’t understand how to do it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2019-05-28
@viktorross

In the article output loop, add an iterator and, for example, check whether the iterator is even or odd and add the necessary

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question