RE: [PHP] how do i get a variable type? - not that simple
| From: | Johnson, Kirk | Date: | Sun, 18 Mar 2001 18:51:02 +0000 |
| Subject: | RE: [PHP] how do i get a variable type? - not that simple | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-44448@lists.php.net to get a copy of this message | ||
How about a regex check for numeric characters with and without a decimal
point (and no leading zeros), versus alphanumerics? Just an "off the top of
my head suggestion", back to work...
Kirk
> -----Original Message-----
>
> ""phpman"" <info@graphicon.nu> wrote in message
> news:99132e$ol8$1@toye.p.sourceforge.net...
> > 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).