Home  >  Article  >  Backend Development  >  自定义模板引擎代码里面这句话看不懂

自定义模板引擎代码里面这句话看不懂

WBOY
WBOYOriginal
2016-06-23 13:16:31900browse

就是最后一句var[]里面\\1是什么意思呢   看不懂啊   


回复讨论(解决方案)

替换正则表达式括号中所匹配的内容。

        /**         * 解析注释         */        private function parNotes()        {            $_patten = '/\{#\}(.*)\{#\}/';            if ( preg_match($_patten, $this->_tplcontent) ) {                $this->_tplcontent = preg_replace($_patten, '<?php /* \1 */ ?>', $this->_tplcontent);            }        }


上面的代码。是解析模板中的注释。

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