删除千位分隔符 PHP

Removing Thousand Separator PHP

我正在尝试格式化产品 Feed 中的数字,删除千位分隔符,我使用了以下代码:

$attributes['Price'] = number_format( $attributes['Price'], 2, '.', ',');

但是对于 1.399,00 的来源价格,我在 Feed 中得到的是

<Price>1,40</Price>

我有点迷茫,请帮忙吗?

完整代码

function alter_feed_price_item_remove_thousand_seperator( $attributes, 
$feed_id, $product_id ) {
global $product;
$product = wc_get_product( $product_id );

// show price without thousand separator
  $attributes['price'] = number_format( $attributes['price'], 2, ',', '') . " EUR";
  // price will look like 1234,57

// IMPORTANT! Always return the $attributes
return $attributes;} 
add_filter( 'wppfm_feed_item_value', 'alter_feed_price_item_remove_thousand_seperator', 10, 3 );
$attributes['Price'] = (double)str_replace(',', '', $attributes['Price']);
function alter_feed_price_item_remove_thousand_seperator( $attributes, $feed_id, $product_id) {
global $product;
$product = wc_get_product( $product_id );

if ($attributes['Sale_Price'] >= 1 && $attributes['Sale_Price'] < 2) { 
$attributes['Sale_Price'] = sprintf(($attributes['Sale_Price'])*1000). ",00";
} 
if ($attributes['Sale_Price'] >= 2 && $attributes['Sale_Price'] < 3) { 
$attributes['Sale_Price'] = sprintf(($attributes['Sale_Price'])*1000). ",00";
}

if ($attributes['Price'] > 1 && $attributes['Price'] < 2) { 
$attributes['Price'] = sprintf(($attributes['Price'])*1000). ",00";
} 
if ($attributes['Price'] > 2 && $attributes['Price'] < 3) { 
$attributes['Price'] = sprintf(($attributes['Price'])*1000). ",00";
}

return $attributes;
}
add_filter( 'wppfm_feed_item_value', 'alter_feed_price_item_remove_thousand_seperator', 10, 3 );