What is the use of the preg_filter () function in PHP
This article mainly introduces what is the use of the preg_filter() function in PHP, which has certain reference value. Interested friends can refer to it. I hope that after reading this article, you will gain a lot. Let Xiaobian take you to understand it together.
preg_filter() function
The preg_filter function is used to perform a regular expression search and replace. preg_filter() is equivalent to preg_replace(), but it only returns results that match the target.
syntax
mixed preg_filter ( mixed $pattern , mixed $replacement , mixed $subject [, int $limit = -1 [, int &$count ]] )
parameter description
$pattern: The pattern to search for. It can be a string or an array of strings.
$replacement: String or array of strings used for replacement.
$subject: String or array of strings to search and replace.
$limit: Optional, maximum number of substitutions per pattern per subject. The default is-1(infinite).
$count: optional, number of substitutions completed.
Thank you for reading this article carefully, I hope Xiaobian shared "What is the use of the preg_filter() function in PHP" This article is helpful to everyone, and I also hope that everyone will support it a lot, pay attention to the industry information channel, and more relevant knowledge is waiting for you to learn!