英寸的preg_replace模式用单词boundry替换PHP


preg_replace pattern for inches replacement PHP with word boundry

我想替换以下内容:

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

在上

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

你知道preg_replace函数的最佳模式是什么吗?

第页。美国最好也有一个词"边界",以避免虚假的假设,即

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