G
G
Good Samaritan2018-05-28 15:43:07
1C-Bitrix
Good Samaritan, 2018-05-28 15:43:07

Why doesn't the code in the news.list template work?

I don't understand why the following code doesn't work

<?foreach($arResult["ITEMS"] as $arItem):?>

            <?if( substr_count($arItem['DETAIL_TEXT'],$arResult['SEARCH_PRASE'])>0):?>

In $arResult['SEARCH_PRASE'] I have a phrase that is in $arItem['DETAIL_TEXT'] n times. But substr_count treacherously says 0

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Good Samaritan, 2018-05-28
@djamali

There was a typo in the code. I decided

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question