Re: how do i get a variable type?

From: Date: Sun, 18 Mar 2001 15:58:33 +0000
Subject: Re: how do i get a variable type?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-44437@lists.php.net to get a copy of this message
PHP, at least php 3.x, has a series of fuctions like is_string, is_integer, is_array etc. I know they're there...I don't us them so I don't know exactly where...this might be what you're looking for... rm --- phpman <info@graphicon.nu> wrote: > hello all, > > let's say i have this: > $a="varone=hello world|vartwo=2.44|varthree=100|"; > > now i do this: > > $b=explode('|',$a); > $z=count($b); > for ($x=0;$x<$z;$x++) { > $tmp=explode('=',$b[$x]); > .... > > and i want to find out if $tmp[1] is a string or an > integer (that's really > all I need to determine so i can put > together an SQL statement that puts single quotes > around strings and none > around integers). Obviously > i won't know at design time all of the variables and > their values. Thank > you. > > -dave > > > > -- > 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 > __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/

« previous php.general (#44437) next »