From 92160fd812ac67001756911d38e54fdb42416e17 Mon Sep 17 00:00:00 2001 From: lub Date: Tue, 27 Aug 2019 16:31:49 +0200 Subject: [PATCH] replace preg_replace with preg_replace_callback /e is not supported starting with php 7.0 --- main.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 +}