You are here: Any idea what's wrong with this code snippet? « PHP Programming Language « IT news, forums, messages
Any idea what's wrong with this code snippet?

Posted by GeoffreyF67 on 09/26/06 02:35

<?

$pattern = "<script[^>]*?>.*?</script>";
$replacement = "";
$subject = " <Description><script
src='http://x.com/rd/j/rf.jsp?pD=41422'></script>Official site. Enjoy
lower rates in the heart of Montreal at the

Fairmont Queen Elizabeth. Save 10% if you book 3 weeks in advance. From
$199 CAD per night. Fairmont, Creating Memories.</Description>";

$test = preg_replace($pattern,$replacement,$subject);

echo $test;
?>

Generates:

Warning: preg_replace(): Unknown modifier ']' in
/web/sites/kerryc/buyers-source-online.com/testme.php on line 9

I just wanna replace the <script tag with nothing...it can't be THAT
hard :)

G-Man

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация