Answer the question
In order to leave comments, you need to log in
How to display html code with tags in php?
I know that Html::stripTags is an output without html tags. And what should be replaced in this piece of code in order to display text with html tags?
if (!empty($arItem['PARAMS']['SECTION']) && !empty($arItem['PARAMS']['SECTION']['DESCRIPTION'])) {
$sDescription = Html::stripTags($arItem['PARAMS']['SECTION']['UF_OPIS'], ['br']);
} else if (!empty($arItem['PARAMS']['ELEMENT']) && !empty($arItem['PARAMS']['ELEMENT']['UF_OPIS'])) {
$sDescription = Html::stripTags($arItem['PARAMS']['ELEMENT']['UF_OPIS'], ['br']);
}
$sDescription = $arItem['PARAMS']['ELEMENT']['UF_OPIS'], ['br'];
Answer the question
In order to leave comments, you need to log in
if (!empty($arItem['PARAMS']['SECTION']) && !empty($arItem['PARAMS']['SECTION']['DESCRIPTION'])) {
$sDescription = $arItem['PARAMS']['SECTION']['UF_OPIS'];
} else if (!empty($arItem['PARAMS']['ELEMENT']) && !empty($arItem['PARAMS']['ELEMENT']['UF_OPIS'])) {
$sDescription = $arItem['PARAMS']['ELEMENT']['UF_OPIS'];
}
// Начиная с PHP 7.4.0, строка выше может быть записана как: // echo strip_tags($text, ['p', 'a']);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question