Function: preg_pattern_quote()

function preg_pattern_quote(string $str, string $delimiter = "/"): string;

Function for escaping the special symbols for putting into the regexp pattern as a simple text in the pattern.

Details

This function escapes all special symbols so that they are treated as a simple text.

Parameters

Name Pass type Value type Default value Description
$str by value string

The string to be escaped.

$delimiter by value string "/"

The string used in the pattern.

Returns

string

The escaped string.

Authors

Oleg Schildt

Package

Source code

See also