Most efficient way to parse custom templates in PHP
<p>Let's say we are writing a custom templating system and we would like a link to be displayed where template contains <code>{{link:http://example.com/something}}click here{{link}}</code>.</p>

<p>What will be the most optimal way to parse this? </p>

<p>Some approaches I can think of: Simple string manipulation using <code>substr</code>. Using <code>preg_replace</code> with back substitution etc. </p>
