Afficher un message
Vieux 16/03/2008, 22h43   #1
Ryan A
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut problem with this regex to remove img tag...

Hey All,

After searching I found this regex to remove img tags from a post, but running it is giving me an error, being a total noob with regex i have no idea what the heck is wrong.... heres the whole script as its tiny:

<?php

$html = " hello ".'<img src="/articles-blog/imgs/paul-fat.jpg" alt="" width="272" height="289" align="left">'. " Paul! ";

$html = preg_replace('</?img((\s+\w+(\s*=\s*(?:".*?"|\'.*?\'|[^\'">\s]+))?)+\s*|\s*)/?>', '', $html);

echo $html;
?>

Any appreciated.

TIA,
Ryan


------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)




__________________________________________________ __________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
  Réponse avec citation
 
Page generated in 0,05771 seconds with 9 queries