I have a function like this:
function in_array_r($item , $array){ return preg_match(\'/\"\'.$item.\'\"/i\' , json_encode($array)); }
an
This is because the slash in your input: blah / blah / something is seen as delimiter for the regex.
blah / blah / something
To solve this you can escape your input with preg_quote(), e.g.
function in_array_r($item , $array){ return preg_match('/"'. preg_quote($item, "/") .'"/i' , json_encode($array)); }