Re: Re: number function

From: Date: Thu, 20 Mar 2003 23:21:59 +0000
Subject: Re: Re: number function
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-140503@lists.php.net to get a copy of this message
This one time, at band camp, "pei_world" <pei_world@hotmail.com> wrote: <php $num = '1234'; if(checkNum($num) == 'FALSE') { echo 'Number is not numeric' } else { echo 'Its a number'; } function checkNum($num){ return is_numeric($num); } > hi > thx for the last question > I have following function, I use it the check all the elements in the array > whether numeric or not. but I get the output : ++l++* and ++0++, the first > char in the string > =============================================================== > function check_int_float($array){ > $result=true; > > for($i=0; $i<sizeof($array); $i++){ > echo "++".$array[strlen($array)]."++"; > if($array[$i]!=""){ > if(isdigit($array[$i]) && $array[$i]!="."){ > $result=true; > }else{ > $result=false; > break; > }//if > }//if > }//foreach > return $result; > } -- ______ (_____ \ _____) ) ____ ____ ____ ____ | ____/ / _ ) / _ | / ___) / _ ) | | ( (/ / ( ( | |( (___ ( (/ / |_| \____) \_||_| \____) \____) Kevin Waterson Port Macquarie, Australia

« previous php.general (#140503) next »