RE: note 47457 rejected and deleted from function.is-numeric by notes editor sean

From: Date: Wed, 17 Nov 2004 23:34:23 +0000
Subject: RE: note 47457 rejected and deleted from function.is-numeric by notes editor sean
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-80677@lists.php.net to get a copy of this message
I don't get it. I was adding information to the book for the usage of the right function at the right place. I was not asking for any help or bug. What is the problem I don't get it? Michel T Dallaire Vice-président VirtuelCOM inc. 36, Durand Loretteville, QC, Canada, G2B 2A5 Tél. : 418-842-8759 Fax : 418-842-8719 michel.dallaire@virtuelcom.com http://www.virtuelcom.com > -----Original Message----- > From: php-notes@lists.php.net [mailto:php-notes@lists.php.net] > Sent: mercredi, 17 novembre 2004 18:34 > To: mdallaire@virtuelcom.com > Subject: note 47457 rejected and deleted from > function.is-numeric by notes editor sean > > > You are receiving this email because your note posted > to the online PHP manual has been removed by one of the editors. > > Read the following paragraphs carefully, because they contain > pointers to resources better suited for requesting support or > reporting bugs, none of which are to be included in manual > notes because there are mechanisms and groups in place to > deal with those issues. > > The user contributed notes are not an appropriate place to > ask questions, report bugs or suggest new features; please > use the resources listed on <http://php.net/support> > for those purposes. This was clearly stated in the page > you used to submit your note, please carefully re-read > those instructions before submitting future contributions. > > Bug submissions and feature requests should be entered at > <http://bugs.php.net/>. For documentation errors use the > bug > system, and classify the bug as "Documentation problem". > Support and ways to find answers to your questions can be > found at <http://php.net/support>. > > Your note has been removed from the online manual. > > ----- Copy of your note below ----- > > I very much like those fuctions. > It removes spaces. > For float numbers, it allows dot or coma for decimal > separator but only one of them in the value. It allows the > number to have a decimal separator with no number after it. > But does not allow a leading separator. For signed numbers, > the minus symbol must be in front. The value can only be > composed of numbers. > > function new_is_unsigned_float($val) { > $val=str_replace(" ","",trim($val)); > return eregi("^([0-9])+([\.|,]([0-9])*)?$",$val); > } > > function new_is_unsigned_integer($val) { > $val=str_replace(" ","",trim($val)); > return eregi("^([0-9])+$",$val); > } > > function new_is_signed_float($val) { > echo $val; > $val=str_replace(" ","",trim($val)); > return eregi("^-?([0-9])+([\.|,]([0-9])*)?$",$val); > } > > function new_is_signed_integer($val) { > $val=str_replace(" ","",trim($val)); > return eregi("^-?([0-9])+$",$val); > } > > You can add features to change the decimal separator or > modify above [\.|,] to \. to accept only a dot. > > Maybe the trim and replace can be done at the same time or > the eregi, but since I never encounter any problem using them > like this, I never tried to modify them again. > > Theyreturn 1 if okay and returns nothing "" if bad number formating. > > Hope they will be as useful for you as they are for me. > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.796 / Virus Database: 540 - Release Date: 2004-11-13 > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.796 / Virus Database: 540 - Release Date: 2004-11-13

« previous php.notes (#80677) next »