- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
$urlKey = 'ftrcvgbhnjk-2000-4628-20.html?hdfjdslkf=sdjfh';
if ($result = preg_match('/-\d+-(\d+)\.html.*$/', $urlKey, $matches)) {
$result = $matches[1];
}
echo $result;
var_dump($matches);
echo $oldUrlKey;