M
M
Michael_Mel2018-06-17 17:15:09
PHP
Michael_Mel, 2018-06-17 17:15:09

Case insensitive preg_match and replacement of found?

I find unnecessary words, but I can’t change ....
I understand that the design "/$item/iu"is not correct, but it $itemalso doesn’t work

foreach($slova as $item)
 {
    if (preg_match("/$item/iu",$opis)) 
    { 
       $opis = str_replace("/$item/iu", "", $opis); 
    }
 }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arman, 2018-06-17
@Mihail_Mel

Why did preg_replace or preg_replace_callback fail? And it would be nice to run variables through preg_quote

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question