RE: [PHP] Probably an easy one

From: Date: Mon, 08 Jan 2001 18:27:20 +0000
Subject: RE: [PHP] Probably an easy one
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-33278@lists.php.net to get a copy of this message
Hey Brandon, Also consider reading (and printing) : Learning to Use Regular Expressions by Example : ------------------------------------------------ http://phpbuilder.com/columns/dario19990616.php3 by Dario F. Gomes It will help explain the example given below and help you expand upon it and eventually create your own regex goodness. Philip On Mon, 8 Jan 2001, Boget, Chris wrote: > > I want to take a variable and make sure it has only the > > characters 1-9 in it. anyone want to give me an example. > > if( ereg( "^[0-9]$+", $yourVar )) { > echo "All numbers, only numbers"; > > } else { > echo "Not all numbers!"; > > } > > Chris >

« previous php.general (#33278) next »