Re: ereg checking if its only numbers

From: Date: Fri, 05 Oct 2001 08:05:21 +0000
Subject: Re: ereg checking if its only numbers
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-70041@lists.php.net to get a copy of this message
That's not regexps Rasmus! :) I always see you referring us the the manual! sometimes you refer to a function i never say in my life! ;) "Rasmus Lerdorf" <rasmus@php.net> wrote in message news:Pine.LNX.4.33.0110042351330.1317-100000@rasmus.php.net... > http://php.net/is_numeric > > On Fri, 5 Oct 2001, Chris Aitken wrote: > > > > > Ive been playing around with ereg for about half an hour and having no joy > > because I dont really understand the medhod behind it and how it all works. > > But what im trying to do is check to see if a 9 digit string is all numbers > > and nothing else > > > > $string1 = "123456789" > > $string2 = "123456abc" > > > > > > how would I check either string with an IF statement and make it continue > > on string 1 (ie, all numbers) and error on string 2 (not all numbers). > > > > > > Any suggestions ? > > > > > > > > Thanks > > > > > > Chris > > > > -- > > Chris Aitken - Administration/Database Designer - IDEAL Internet > > email: chris@ideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890 > > __-----------------------------------------__ > > It is said that if you line up all the cars in the world end to end, > > some moron in a rotary will still to try and pass them > > > > > > >

« previous php.general (#70041) next »