4 sty 2013

Wyrażenie regularne i preg_match

$test='http://kody.wig.pl/strony-stare-2006_11-all.html';
$test='http://kody.wig.pl/strony-nowe-2012_11-1233.html';
echo $test;
preg_match("/(-(?P([0-9]+|all)))?\.html$/", $test, $back);
print_r($back);