A
A
Alex Lav2020-05-29 11:47:28
PHP
Alex Lav, 2020-05-29 11:47:28

How to determine the presence of a word in and display a specific text?

Hello, help to determine the presence of the word "Word1" in the line And if there is such a word in the line, then display the text . If there is no word, then do not display anything.
<p>Слово1</p>
Текст который нужно вывести

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Edward, 2020-05-29
@IS-Builder

$str = '<p>Слово1</p>';

if (mb_stripos($str, 'слово1') !== false) {
    echo 'Текст который нужно вывести';
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question