时间:2021-07-01 10:21:17 帮助过:8人阅读
[img]XXXXXXg;base64,iVQA/XXXXXXXXXXXXXXX[/img]
$s = '[img]XXXXXXg;base64,iVQA/XXXXXXXXXXXXXXX[/img]';echo preg_replace('/(?<=])[^[]+/', '', $s);[img][/img]
$s = '[img]XXXXXXg;base64,iVQA/XXXXXXXXXXXXXXX[/img]';echo preg_replace('/(?<=])[^[]+/', '', $s);[img][/img]
$s = '[a]XXXXXXg;base64,iVQA/XXXXXXXXXXXXXXX[/a]';echo preg_replace('/(?<=])[^[]+/', '', $s);[a][/a]
echo preg_replace('/(?<=\[img\])[^[]+/', '', $s);
$str = '[img]XXXXX[/img]';$regx = '/\[img\](.*)\[\/img\]/';$rep_result = preg_replace_callback( $regx, function($match){ return str_replace($match[1],'',$match[0]); }, $str);