Home >Backend Development >PHP Tutorial >Regular Expressions and the Position of /_PHP Tutorial

Regular Expressions and the Position of /_PHP Tutorial

WBOY
WBOYOriginal
2016-07-14 10:08:09680browse

[php]

define('DEDEADMIN', preg_replace("/[\/]{1,}/", '/', dirname(__FILE__) ) );
Note that the first in [\/] is actually an independent text character, and / means escaping the meaning of / into an ordinary text character
If you replace the content in the regular expression [] with [/] or [/\], it will not work. An error will be reported.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477802.htmlTechArticle[php] span style=font-family:SimSun;define(DEDEADMIN, preg_replace(/[\/]{ 1,}/, /, dirname(__FILE__) ) );/span Note that the first one in [\/] is actually an independent text character, and...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn