- preg_match: documentation ( source)
<?php
//echo preg_match("/[0-9]*(\.|[0-9]{1})[0-9]{0,2}/","00.00");
$regexp = '[0-9]*(\.|[0-9]{1})[0-9]{0,2}';
echo _match($regexp, array('00.00','salkjfdsklfj'));
function _match($regexp,$subject_array) {
$match = true;
foreach ($subject_array as $subject) {
if (!preg_match("/".$regexp."/",$subject)) {
$match = false;
}
}
return $match;
}