<?php
function formatFromMaskMoney($value) {
if (preg_match('/^[0-9.]+[,]( |)\d{2}$/', $value) !== 0) { }
return $value;
}
//Simula POST
'a' => '1.000.000,00',
'b' => '3.456.789, 12',
'c' => '4.233.456.700, 99'
);
$test = array_map('formatFromMaskMoney', $test); print_r($test);//Para verificar os dados antes de usa-los.
PD9waHAKZnVuY3Rpb24gZm9ybWF0RnJvbU1hc2tNb25leSgkdmFsdWUpIHsKICAgIGlmIChwcmVnX21hdGNoKCcvXlswLTkuXStbLF0oIHwpXGR7Mn0kLycsICR2YWx1ZSkgIT09IDApIHsKICAgICAgICAkdmFsdWUgPSBzdHJfcmVwbGFjZSgnICcsICcnLCAkdmFsdWUpOwogICAgICAgICR2YWx1ZSA9IHN0cl9yZXBsYWNlKCcuJywgJycsICR2YWx1ZSk7CiAgICAgICAgJHZhbHVlID0gc3RyX3JlcGxhY2UoJywnLCAnLicsICR2YWx1ZSk7CiAgICAgICAgJHZhbHVlID0gbnVtYmVyX2Zvcm1hdCgkdmFsdWUsIDIsICcsJywgJy4nKTsKICAgIH0KCiAgICByZXR1cm4gJHZhbHVlOwp9CgovL1NpbXVsYSBQT1NUCiR0ZXN0ID0gYXJyYXkoCgknYScgPT4gJzEuMDAwLjAwMCwwMCcsCgknYicgPT4gJzMuNDU2Ljc4OSwgMTInLAoJJ2MnID0+ICc0LjIzMy40NTYuNzAwLCA5OScKKTsKCiR0ZXN0ID0gYXJyYXlfbWFwKCdmb3JtYXRGcm9tTWFza01vbmV5JywgJHRlc3QpOwpwcmludF9yKCR0ZXN0KTsvL1BhcmEgdmVyaWZpY2FyIG9zIGRhZG9zIGFudGVzIGRlIHVzYS1sb3Mu