Unknown modifier ‘/’ in …? what is it? [duplicate]

I assume $value contains a slash /, which is not escaped by preg_quote:

The special regular expression characters are: . \ + * ? [ ^ ] $ ( ) { } = ! < > | : -

Pass the delimiter you use to the function:

preg_match_all("/[^\s]*".preg_quote($value, "https://stackoverflow.com/")."[^\s]*/iu", $row_search['content'], $final_matched);
//                                        ---^

or use another delimiter.

Leave a Comment