Remove all characters except numbers and letters from a string in PHP

<?php

$string = ‘your string’;

$new_string = ereg_replace( ‘[^A-Za-z0-9]‘, ”, $string);

echo $new_string;

?>

Comments are closed.