晕,我试图用preg_replace
'\b'
替换php中常量值的完整单词,但我收到了错误。
以下是我的代码段:
<?php
$refinedName = str_replace(explode(",", Constants::$master_refine_categories[$_GET["category"]]), '',$refinedName);
foreach ($refinedName as $item) {
$item = preg_replace('/\b$item\b/','',$refinedName);
}
?>