function add_gst( $_ni_cost_goods = null, $multiplier = 1.1) {
if ( !empty( $_ni_cost_goods ) ) {
// strip any extra characters from price
$_ni_cost_goods = preg_replace("/[^0-9,.]/", "", $price);
// perform calculations
return $_ni_cost_goods * $multiplier;
}
}
$
在多个地方签署“NIU cost”商品。也就是说,你也在访问一个变量
$price
它不在函数的范围内。