Running the following code:
preg_match("/^top\-sites\-csv\_(.+)\_/i", $file, $matches);
$site_id = $matches[1];
And it keeps generating this notice:
PHP Notice: Undefined offset
I guess its happening when the regex does not find a match. problem is that the script is on a cron and my error log grows huge in no time and then needs manual cleaning..
preg_match($pattern, $subject, $matches, PREG_OFFSET_CAPTURE, 3);if (preg_match($pattern, $text, $matches))to check if there were any matches.