I discovered the same thing, that all values from text fields ARE
text, i.e. strings. Also, that an empty field IS set upon return,
s...
To check for empty field, check for empty STRING equivalence:
if ( $input_var_from_form == "" ){
Do something because
To: [EMAIL PROTECTED]
Subject: RE: [PHP] how do i get a variable type? - not that simple
I discovered the same thing, that all values from text fields ARE
text, i.e. strings. Also, that an empty field IS set upon return,
s...
To check for empty field, check for empty STRING e
Very interesting! I'd think it would be a bug if it did work that way.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
ime",TRUE, "20:09:07");
TestVF("time","IsValidTime",FALSE, "24:09:07");// hour must
be 00 thru 23
TestVF("time","IsValidTime",FALSE, "20:60:07");// minute
must be 00 thru 59
TestVF(&
// not
HH:MM:SS format
TestVF("time","IsValidTime",TRUE, "20:09:07");
TestVF("time","IsValidTime",FALSE, "24:09:07");
// hour must
be 00 thru 23
TestVF("time","IsValidTime",FALSE, &quo
else print("is not a number");
}
?
Moody
-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
Sent: 19 March 2001 15:55
To: [EMAIL PROTECTED]
Subject: RE: [PHP] how do i get a variable type? - not that simple
Jim,
Thanks for sharing all your hard work. Have you
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 [EMAIL PROTECTED] wrote:
hello all,
let's say i have this:
No guys. that doesn't work. Take this code for example...
$a="3";
echo(gettype($a));
this returns string
i need to find it as an integer or real or float for the sql. which by the
way is MySQL.
thank you for responding, but I already know that gettype and all the other
is_* don't work for
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"" [EMAIL PROTECTED] wrote in message
99132e$ol8$[EMAIL
I would right a function that would return a result and try an match within
the different types.
if (isdate($a))
{
Dtype = date;
}
if (isdigit($a))
{
Dtype = int;
}
return (Dtype);
etc..
At 01:44 PM 3/18/01 -0500, phpman wrote:
No guys. that doesn't work. Take this code for example...
To: [EMAIL PROTECTED]
Sent: Sunday, March 18, 2001 12:44 PM
Subject: [PHP] how do i get a variable type? - not that simple
No guys. that doesn't work. Take this code for example...
$a="3";
echo(gettype($a));
this returns string
i need to find it as an integer or real or float for the sq
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
12 matches
Mail list logo