Codice PHP:
$str '12,34';
$num str_replace(',''.'$str);
if(
is_numeric($num)) echo $num