开发者

preg_replace pattern for inches replacement PHP with word boundry

I would like to replace something like:

Remo Suede Emperor Drumhead 12" or
Remo Suede Emperor 12" Drumhead

on

Remo Suede Emperor Drumhead 12inch or
Remo Suede Emperor 12inch Drumhead

Do you know what pattern would be best for preg_replace function ?

P.S. would be good to have a word boundry in there too to avoid false positivies replacamenet i开发者_开发技巧e.

123M90"


$string = preg_replace('/([0-9])"/', '$1inch', $string);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜