Re: Quick help

From: Date: Wed, 01 Nov 2000 07:10:36 +0000
Subject: Re: Quick help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-23106@lists.php.net to get a copy of this message
Well you can look at the substr() function or you can do this (this is pretty cool - but not as efficient as substr()) $var = 'Foobar'; for($i = 0 ; $i < 3 ; ++$i){ echo $var[$i]; } output: 'Foo'; --Joe On Tue, Oct 31, 2000 at 09:47:49PM -0500, Curtis, Lorenzo wrote: > Can anyone tell me how to read the first three characters (numbers) of a > variable? > > I want to read only the first three numbers from a string of numbers all > saved in a mySQL text field > with no delimiters. > > -Lorenzo > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net ================================================================================ = Joe Stump joestump98@yahoo.com http://www.miester.org = ================================================================================ "Real programmers don't comment their code. It was hard to write, it should be hard to understand."

« previous php.general (#23106) next »