PHP Remove characters except letters and numbers from a string – PHP August 9, 2011 Pramod T P Leave a comment <?php $var = “!P$%H^P&”; $var1 = ereg_replace(“[^A-Za-z0-9]”, “”, $var); echo $var1; ?>