Answer the question
In order to leave comments, you need to log in
How to make an antonym for a tag in php?
There is a tag
[isparent] текст [/isparent]
This tag displays the text contained in them if the category is a parent category and contains subcategories.
His code:
if(!isset($row['children'])) {
$template = str_replace( "{sub-item}", "", $template );
$template = preg_replace( "'\\[isparent\\](.+?)\\[/isparent\\]'si", "", $template );
} else {
$template = str_replace( "[isparent]", "", $template );
$template = str_replace( "[/isparent]", "", $template );
}
[isnotparent] текст [/isnotparent]
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