- var_dump: documentation ( source)
- preg_match: documentation ( source)
<?php
$path = '/www/nikita/tickets/web/img/news/29/29/promo_cover.jpg';
$matches = [];
var_dump([
'result' => preg_match('/\/img\/news\/(\d+)\/(\d+)\/promo_cover\.jpg/', $path, $matches),
'matches' => $matches,
]);