Remove All Characters except Letters and Numbers (alphanumeric)

Unwanted characters in HTML output can be a pain. Here's a quick way to get rid of them:

ereg_replace("[^A-Za-z0-9]", "", $string);

Send in any improvements via comments :)

No comments:

Post a Comment