Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   preg_match(): error (http://www.bvlist.com/showthread.php?t=12335)

elvira 13th February 2021 00:30

preg_match(): error
 
Hello all,


need little help here


Warning: preg_match(): Unknown modifier '/' in /home/admin...........

This line:

function boundary($w,$s) {
return preg_match("/\b$w\b/i", $s, $w);
}

DND 13th February 2021 12:44

Using / as a delimiter means you also need to escape it here, like so: <\/>.
https://stackoverflow.com/questions/...known-modifier

elvira 13th February 2021 13:55

I use this and works


PHP Code:

function boundary($w,$s) {return preg_replace('/\b' preg_quote($w'/') . '\b/i'$s$w);} 


DND 13th February 2021 14:11

good


All times are GMT +2. The time now is 23:33.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.