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

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

WBOY
Release: 2016-06-23 13:16:31
Original
961 people have browsed it

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


回复讨论(解决方案)

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

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


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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template