Re: How to check if a *string* has only numbers...
| From: | Larry E . Ullman | Date: | Wed, 17 Nov 2004 01:41:41 +0000 |
| Subject: | Re: How to check if a *string* has only numbers... | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-24983@lists.php.net to get a copy of this message | ||
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