Manual 1 komentarz

<?php
$url = "http://test.com";
if ($text)
{
$src_href_url=run_preg($text,
"/(?:(?:src|href|url)\\s*[=\\(]\\s*[\\"'`])".
"([\\+\\w:?=@&\\/#._;-]+)(?:[\\s\\"'`])/i");
$windows=run_preg($text,
"/(?:window.open\\s*\\(\\s*[\\w-]*\\s*[,]\\s*[\\"`'])".
"([\\+\\w:?=@&\\/#._;-]*)(?:[\\"'`]\\s*)/i");
}
function run_preg($text,$pattern) {
preg_match_all ($pattern, $text, $matches);
if (count($matches)>0)
if (count($matches[1])>0)
foreach ($matches[1] as $k => $v)
echo "$k: $v\\n";
return (is_array($matches)) ? $matches[1]:FALSE;
}
?>
Polecam lekture
preg_match_all" title="Zobacz w manualu php" target="_manual() masz tam sporo przykladów w komentarzach, popatrz na nie