Preg_replace不适用于PHP中的$(美元)符号

时间:2019-01-04 13:34:23

标签: php replace preg-replace

在Php Preg_replace中,当我们使用$时,它将删除附近的int

示例$pattern = '/\*\|Coupon\|\*/i'; $coupon = '$15t'; $string = 'test coupon *|Coupon|*'; echo preg_replace($pattern, $coupon, $string);

然后输出为't',但预计输出$ 15t

0 个答案:

没有答案