RE: [PHP] how do i get a variable type? - not that simple

2001-03-20 Thread Dennis Gearon
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

RE: [PHP] how do i get a variable type? - not that simple

2001-03-20 Thread Rudolf Visagie
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

Re: [PHP] how do i get a variable type? - not that simple

2001-03-20 Thread Dennis Gearon
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]

RE: [PHP] how do i get a variable type? - not that simple

2001-03-19 Thread Ide, Jim
These are the functions I use to determine if a string value is a valid integer, real, date, etc. Hope this helps. ps - please let me know if you find any errors. thanx. ?php function IsValidBoolean($p) { if ( isset($p) ) { if ((strtolower($p) == "true") or

RE: [PHP] how do i get a variable type? - not that simple

2001-03-19 Thread Johnson, Kirk
do i get a variable type? - not that simple These are the functions I use to determine if a string value is a valid integer, real, date, etc. Hope this helps. ps - please let me know if you find any errors. thanx. ?php function IsValidBoolean($p) { if ( isset($p

RE: [PHP] how do i get a variable type? - not that simple

2001-03-19 Thread Mahmoud Abu-Wardeh
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

RE: [PHP] how do i get a variable type? - not that simple

2001-03-18 Thread Johnson, Kirk
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

Re: [PHP] how do i get a variable type? - not that simple

2001-03-18 Thread Rick St Jean
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...

Re: [PHP] how do i get a variable type? - not that simple

2001-03-18 Thread Mark Charette
Personally I'd perform a query into MySQL and get what _it_ thinks the values should be ... before doing anything else. It allows generality in your error checking code. Look at mysql_list_fields() et al. mark C. - Original Message - From: "phpman" [EMAIL PROTECTED] To: [EMAIL