
28.12.2008, 11:48
|
|
Постоянный
Регистрация: 30.08.2007
Сообщений: 773
С нами:
9840758
Репутация:
808
|
|
PHP код:
<pre>
<?
$text = <<<markup
<form action=http://example.com></form>
<form action="http://example.com"></form>
<form action='http://example.com'></form>
<form action = "http://example.com"></form>
<form action ="http://example.com"></form>
<form action= "http://example.com"></form>
markup;
$pattern = <<<regexp
~action\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)~
regexp;
$text = preg_replace($pattern, 'action="my.php"', $text);
echo htmlspecialchars($text);
?>
</pre>
|
|
|