News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Paste-1273966662:v:use_geshi-1:v:type-php

Started by SleePy, May 15, 2010, 11:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SleePy

<?php

$tests = array(
   "123456",
   "123456\n",
);

foreach($tests AS $test)
{
   $good = preg_match('~^[0-9]+$~', $test);

   echo '"', $test, '" ', $good ? 'is' : 'is not', ' good
';
}

?>
No siggy! :D