@bokehFeb 06.2007 — #could it find and remove the commas?[/QUOTE]That is a very ill thought-out validation technique. Instead of a blacklist you should have a whitelist of allowed characters. For example if you want to allow only decimal digits you could use the following: [code=php]$digits = preg_replace('/[^d]/', '', $WithCommas); [/code]
Can PHP count the number of characters in a string?[/QUOTE]strlen()
@Mr_Initial_ManauthorFeb 06.2007 — #That is a very ill thought-out validation technique. Instead of a blacklist you should have a whitelist of allowed characters. For example if you want to allow only decimal digits you could use the following: [code=php]$digits = preg_replace('/[^d]/', '', $WithCommas); [/code] [/QUOTE]
It has nothing to do with validation. It has to do with counting how many digits there are in, say, 1,000.
@bokehFeb 06.2007 — #It has nothing to do with validation. It has to do with counting how many digits there are in, say, 1,000.[/QUOTE]It is still ill-conceived; white-listing is always better. [code=php]<?php