sub numeric_p {
local($data) = @_;
if ($data =~ /^-?\d*\.?\d*(e\d|e-\d)?\d*$/) {
$true;
} else {
$false;
};
}
How can I translate this piece of code to PHP? The only piece I can’t translate is the piece on the 3rd line, starting with if.
How can I do that?
This is a test if
$datamatches the following regular expression. It just becomes a call topreg_match()in PHP: