PHP regex templating - find all occurrences of {{var}}

后端 未结 3 767
臣服心动
臣服心动 2020-12-04 00:01

I need some help with creating a regex for my php script. Basically, I have an associative array containing my data, and I want to use preg_replace to replace some place-ho

3条回答
  •  情歌与酒
    2020-12-04 00:31

    For well-formed HTML/XML parsing, consider using the Document Object Model (DOM) in conjunction with XPath. It's much more fun to use than regexes for that sort of thing.

提交回复
热议问题