diff --git a/main.php b/main.php index 13f30bd..c3d6ae8 100644 --- a/main.php +++ b/main.php @@ -34,9 +34,11 @@ while(true) { $delete = true; } if($i == $groupCount AND $delete == false) { - $regex = '#([0-9]{1,3})#e'; - $replacement = '("$1" + 1)'; - $newName = preg_replace($regex, $replacement, $group['channel_name']); + $regex = '#([0-9]{1,3})#'; + $callback = function ($matches) { + return $matches[0]+1; + } + $newName = preg_replace($regex, $callback, $group['channel_name']); createChannel($server, $newName, $sub, $options); } } @@ -46,4 +48,4 @@ while(true) { } } sleep(1); -} \ No newline at end of file +}