Ben Miller wrote:
> OK - easy one here, I know. Having troubles removing anything that is not
> a
> number from user input. According to manual, [!] is supposed to mean set
> of
> non-matching optional characters. Tried
! means that, but only in a completely different context from what you are
On Mon, 14 Feb 2005 18:54:03 -0700, Ben Miller <[EMAIL PROTECTED]> wrote:
> OK - easy one here, I know. Having troubles removing anything that is not a
> number from user input. According to manual, [!] is supposed to mean set of
> non-matching optional characters.
$var = preg_replace( '/[^\d]/'
OK - easy one here, I know. Having troubles removing anything that is not a
number from user input. According to manual, [!] is supposed to mean set of
non-matching optional characters. Tried
$var = ereg_replace("[!0-9]","",$var);
and it removes the numbers, but so does
$var =
3 matches
Mail list logo