PHP7 abandoned preg_replace how to adjust, ask for help

problem description

was originally cleared when dealing with the later parameter substitution in url in php5. The code is as follows:
$url = preg_replace ("/ ([? &]) src= [^ &] + (&?) / eBay,""$2" = = "?": "$1", $url);
but an error in php7
needs to be replaced with preg_replace_callback.

related codes

$url = preg_replace ("/ ([? &]) src= [^ &] + (&?) / eBay,""$2" = = "?": "$1", $url);

Php
Oct.21,2021

The

e modifier has been marked as content to be removed since 5.3 because of security concerns.
is replaced by preg_replace_callback,. The second parameter of this method is a callback function, and the callback function automatically passes in the matching packet as the parameter. The matching group is accessed through the array subscript inside the callback function. (mobile phone codeword is not formatted)

$url="https://abc.com/?a=1&src=2&b=3";
$url = preg_replace_callback("/([?&])src=[^&]+(&?)/is", function($m){ return $m[2]==""? "": $m[1]; }, $url);
echo $url;
//$url="https://abc.com/?a=1&b=3";
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3674c-2b860.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3674c-2b860.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?