Help with preg_replace

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jalexanderdh
Forum Newbie
Posts: 1
Joined: Wed Feb 17, 2010 5:35 am

Help with preg_replace

Post by jalexanderdh »

My client's newsletter has a problem and I need to fix it.
It is a hardcoded newsletter built for wordpress, but it is showing these messy shortcodes:

[caption id="attachment_xxxx" align="desiredalignment" width="xx" caption="Whatever caption text"] <--! actual image shows here-->[/caption]

It has this line -
$text=preg_replace('/\<p class\=\"imagecaption.*?\/p>/i', '', $text);

I was thinking I need to change something in preg_replace to filter the caption shortcode - can anyone help?
Post Reply