Home > Article > Backend Development > What does slash mean in php
There are two types of slashes in php, namely: 1. The forward slash "/" symbol, which is equivalent to a bracket wrapping the content; 2. The backslash "\" symbol, which represents an escape character .
The operating environment of this article: Windows 7 system, PHP version 7.1, DELL G3 computer
What do the slashes in php mean?
php The difference between forward slash '/' and backslash '\'
$val = preg_replace('/([\x00-\x08,\x0b-\x0c,\x0e-\x19])/', '', $val);
Forward slash is used to wrap the content equivalent to a bracket;
The backslash is:
Marks the next character as a special character, or a literal character, or a backward reference, or an octal escape character.
For example, 'n' matches the character "n". '\n' matches a newline character. The sequence '\\' matches "\" and "\(" matches "(".
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What does slash mean in php. For more information, please follow other related articles on the PHP Chinese website!