标签: php replace preg-replace
在Php Preg_replace中,当我们使用$时,它将删除附近的int
示例$pattern = '/\*\|Coupon\|\*/i'; $coupon = '$15t'; $string = 'test coupon *|Coupon|*'; echo preg_replace($pattern, $coupon, $string);
$pattern = '/\*\|Coupon\|\*/i'; $coupon = '$15t'; $string = 'test coupon *|Coupon|*'; echo preg_replace($pattern, $coupon, $string);
然后输出为't',但预计输出$ 15t