Jump to content

preg_match not doing much


shotza

Recommended Posts

Hi folks

I'm very new at php and writing code in general so please be gentle with me :)

I'm trying to write an if statement that will check for numeric input unfortunatley the code isnt trapping any text input.

The statement is as follows:

if (!preg_match('/[[:^digit:]]/', $seconds)) {
echo "<h1>Laptime must contain numeric values only! </h1>
<p>Please hit the <b>Back Button</b> on your browser to re-enter information";
exit();
}#end if

Any pointing out of stupid mistakes would be greatly appreciated!

Link to comment
https://forums.phpfreaks.com/topic/33603-preg_match-not-doing-much/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.