lacee1986
4/3/2017 - 4:21 PM

Regex

Regex

/* Leave only numbers and letters */
$clean_code = preg_replace('/[^\w]/', '', $string);

/* More controll */
$clean_code = preg_replace('/[^a-zA-Z0-9]/', '', $string);