I've looked at other solutions here and here, but it's not working for me.
Code
$s1clean = 'ALIEN - FILM - MOVIE – PSP – Sony - Boxed & Complete';
echo $s1clean;
echo "<br><br>";
// Remove dash
$s1clean = str_replace('-', '', $s1clean);
// Remove em dash
$em_dash = html_entity_decode('–', ENT_COMPAT, 'UTF-8');
$s1clean = str_replace($em_dash, '', $s1clean);
$em_dash2 = html_entity_decode('—', ENT_COMPAT, 'UTF-8');
$s1clean = str_replace($em_dash2, '', $s1clean);
$s1clean = str_replace('\u2014', '', $s1clean);
echo $s1clean;
echo "<br><br>";
Output
"ALIEN FILM MOVIE – PSP – Sony Boxed & Complete"
How do I remove this character?
This specifies an array of possible removals,
$s1clean = 'ALIEN - FILM - MOVIE – PSP – Sony - Boxed & Complete';
$s1clean = str_replace(["-", "–"], '', $s1clean);
echo $s1clean;
When ran,
Ouput
ALIEN FILM MOVIE PSP Sony Boxed & Complete
I simply copied the weird dash and added it with the actual dash possibility and it worked.
Reading Material