A little preg_replace help!

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
iBroughtCookies
Forum Newbie
Posts: 10
Joined: Wed Jun 24, 2009 12:09 pm

A little preg_replace help!

Post by iBroughtCookies »

I've got some really ugly HTML I'm writing a script to fix using PHP... It's generated by Microsoft Word! D:
I don't think it should be done either, but someone is paying me to do it! I finished just about everything, except my image-display problem, and I'm taking guesses as to how I should fix it...

So, the idea I'm currently working at, at the minute is removing this "V:shapes" crap I've never heard of before...

Here's what it looks like:

Code: Select all

<!--[if gte vml 1]> 
BAD STUFF
<![endif]--><![if !vml]>
GOOD STUFF
v:shapes="_x0000_i1026"
GOOD STUFF
<![endif]>
How do I write a preg_replace code to fix this?
Last edited by Benjamin on Wed Jun 24, 2009 12:47 pm, edited 1 time in total.
Reason: Changed code type from text to html.
Post Reply