Posted By

Tate on 03/18/08


Tagged


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

luman
skywalker
mb
pixelhandler
vali29


Remove any characters that are not numbers or letters


 / Published in: PHP
 

  1. $string = "This is some text and numbers 12345 and symbols !£$%^&";
  2. $new_string = ereg_replace("[^A-Za-z0-9]", "", $string);
  3. echo $new_string

Report this snippet  

You need to login to post a comment.