I need a little help. Because preg_replace
is deprecated, I have to convert all my preg_replace
to preg_replace_callback
when i tried to change it its always showing some error.
i have tried
Change:
$importedOptions = preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $importedOptions);
To:
$importedOptions = preg_replace_callback(
'!s:(\d+):"(.*?)";!e',
function() { return "'s:'.strlen('$2').':\"$2\";'"; },
$importedOptions
);
i have tried other approaches to but did not success please help me in this
Thanks