Remove any characters that are not numbers or letters


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.