I have this HTML that I am reading from wordpress into a regular PHP file. This is not valid HTML but wordpress is supposed to strip the [caption] out take the img tag, and put it into a div with the caption as a <p>
tag. But I want to do this in PHP, with no wordpress.
[caption id="" align="alignnone" width="190" caption="my caption"]html image tag would got here but got stripped[/caption]
How would you do this in a regular expression. I am thinking of somehow using preg_match_callback here somehow.