Hi guys,
I got some HTML with homemade tags and I would like to parse it and get an array of the result.
For example :
<h1>Hello World</h1>
{: foo :}
<p>some dummy text</p>
{: bar :}
<p>some dummy text</p>
My goal is to replace the {: foo :} and {: bar :} by some homemade php widgets.
Here is the code I'm using now, but it's not working :
$pattern = "/\{\: (.*) \:\}/";
if(preg_match_all($pattern,$snippet, $matches)){
foreach( $matches as $item )
{
$widgetname = $item[1] ;}
}
}
Let me know if I make myself clear... Any ideas would be more than welcome, I'm stuck !
Thanks in advance !