From: "Richard Davey" <[EMAIL PROTECTED]>

> I'm sure this is blindingly simple, but could anyone tell me how to
> get an ereg_replace() to return a string where all characters OTHER
> than alpha-numerics have been stripped out?

$output = ereg_replace('[^a-zA-Z0-9]','',$string);

The ^ is NOT (when the first character in a bracketed character set). So
anything NOT alphanumeric is replaced.

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to