Re: How to check if a *string* has only numbers...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I would like to check if a string contains only numbers, I really can’t
realize how to do it.

is_numeric()

$data = $_POST[‘data’]; // something like 123.456.789
$dataParts = explode($data);
//these are the variable I have to check:
$dataP1 = $dataParts[0];
$dataP2 = $dataParts[1];
$dataP3 = $dataParts[3];

should probably be $dataP3 = $dataParts[2];

Larry
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux