SleePyCode Forums

Special Site & Other Boards => PasteBin => Topic started by: SleePy on May 15, 2010, 11:37 PM

Title: Paste-1273966662:v:use_geshi-1:v:type-php
Post by: SleePy on May 15, 2010, 11:37 PM
<?php

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

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

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

?>