Function __global->preg_replace
Definitions
sources_custom/phpstub.php
- Perform a regular expression search and replace.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $pattern | mixed | No | No | required parameter | N/A | N/A | The pattern (string or array) |
| $replacement | mixed | No | No | required parameter | N/A | N/A | The replacement string (string or array) |
| $subject | mixed | No | No | required parameter | N/A | N/A | The subject string (string or array) |
| $limit | integer | No | No | -1 | N/A | N/A | The limit of replacements (-1: no limit) |
| &$count | integer | Yes | No | 0 | N/A | N/A | Number of replacements made |
Returns
- The string with replacements made (null: error)
- Type: ?mixed
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Perform a regular expression search and replace.
*
* @param mixed $pattern The pattern (string or array)
* @param mixed $replacement The replacement string (string or array)
* @param mixed $subject The subject string (string or array)
* @param integer $limit The limit of replacements (-1: no limit)
* @param integer $count Number of replacements made
* @return ?mixed The string with replacements made (null: error)
*/
function preg_replace($pattern, $replacement, $subject, int $limit = -1, int &$count = 0)
* Perform a regular expression search and replace.
*
* @param mixed $pattern The pattern (string or array)
* @param mixed $replacement The replacement string (string or array)
* @param mixed $subject The subject string (string or array)
* @param integer $limit The limit of replacements (-1: no limit)
* @param integer $count Number of replacements made
* @return ?mixed The string with replacements made (null: error)
*/
function preg_replace($pattern, $replacement, $subject, int $limit = -1, int &$count = 0)
