PHP: Remove Everything But Letters And Numbers – Reg Expressions

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

Copy this code and paste it in your HTML
  1. $string = "remove ever^&thing but *&^*&%£ letters & numbers*&^*";
  2. $cleansedstring = ereg_replace("[^A-Za-z0-9]", "", $string );
  3. echo $cleansedstring;


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.