<?php $datas = [ '123.456', '123', '123,456', ]; foreach($datas as $index => $data){ echo "$index. ".(int)preg_match('/^\d*(?:\.[0-9]+)?$/', $data).PHP_EOL; }
You have javascript disabled. You will not be able to edit any code.