A
A
Anto2021-03-11 15:15:04
1C-Bitrix
Anto, 2021-03-11 15:15:04

How to remove such a character?

Good afternoon!

Tell me how to remove such a symbol prnt.sc/10itp81 in the text it is not there, but on the line it is displayed like this:

<p><?=substr($arItem['PREVIEW_TEXT'], 0, 450);?>...</p>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anto, 2021-03-24
@ZIROKUL

Yaroslav Alexandrov , Evgeniy , solution to the problem: the field $arItem['PREVIEW_TEXT'] was truncated as standard through the component, but there is another text field <?=substr($arItem['RU_PREVIEW_TEXT'], 0, 450);?> it was truncated - errors no.
Thanks everyone for the help!

E
Eugene, 2021-03-11
@udjin123

You're truncating a multi-byte encoding with a single-byte function.
Use the TruncateText Bitrix function.
Documentation here https://dev.1c-bitrix.ru/api_help/main/functions/s...
Also check the correctness of the mbstring settings in PHP

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question