- You need make choise between return output or echo 🙂
- You forget to change the variable $input by $output on the line .5
-
You made $output between ”!!
$output = str_replace("'", '', $output);
This line erase the effect of those lines before it:
$output = str_replace('’', '\'', $output); $output = preg_replace('\'/\\s/\'', ', \'\',', '$output');
Try this :
function cleanHTML($input){
$blank_letter = array('â„¢','Â','∞','•',"â€","...");
$output = str_replace($blank_letter, '', $input);
$output = str_replace('’', '\'', $output);
$output = str_replace(' ', ' ', $output);
$output = preg_replace('\'/\\s/\'', ', \'\',', $output);
$output = ltrim($output);
$output = rtrim($output);
return $output;
}