I have a lot of difficulties in this REGEX stuff, can any one help improve my code? Thank you in advanced.
What I need is to get the content in side the [Slide] CONTENT [/Slide] tags. What i am doing is:
preg_match ('/\[Slide\].*\[\/Slide\]/s', $content, $matches);
$conteudo_slide = $matches[0];
$conteudo_full = preg_replace('/\[Slide\]/s', "", $conteudo_slide);
$conteudo_full = preg_replace('/\[\/Slide\]/s', "", $conteudo_full);
the content of the page is:
<p>[Slide]http://www.gprco-cpa.com/images/industries/corporations.jpg[/Slide]</p>
<p>[Slide]http://www.expatcpa.com/Corporation_HQ.jpg[/Slide]</p>
<p><br />[Slide]</p>
<p><a href="http://localhost/~tiago/main_wordpress/?attachment_id=437" rel="attachment wp-att-437">
<img class="alignright size-full wp-image-437" title="lightbulb"src="http://localhost/~tiago/main_wordpress/wpcontent/uploads/2012/09/lightbulb1.jpg" alt="" width="500" height="334" /></a>[/Slide]</p><p> </p>
<p>[Slide]http://www.youtube.com/watch?v=SHVOyGVQ3Tw&feature=g-all-u[/Slide]</p>
Isn´t any more correct way of doing this? Thank you.