[int$limit = -1],
preg_filter is identical to preg_replace except it only returns the (possibly transformed) subjects where there was a match. For details about how this function works, read the preg_replace documentation.
Parameters are described in the documentation for preg_replace.
Returns an array if the subject parameter is an array, or a string otherwise.
If no matches are found or an error occurred, an empty array is returned when subject is an array or null otherwise.
Exceptions and Errors
If the regex pattern passed does not compile to a valid regex, an E_WARNING is emitted.