Ho visto altre soluzioni here e here, ma non funziona per me.Come rimuovere il trattino 'em' da una stringa?
Codice
$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>";
uscita
"movie film ALIEN - PSP - Sony Boxed & Complete"
Come rimuovo questo personaggio?
Altre spiegazioni su tipi di trattini, endash è quello breve, emdash è quello lungo - > Non confondere il trattino (-) per il trattino un po 'più stretto (-) o il trattino ancora più stretto (-). Questi marchi hanno scopi diversi e sono ulteriormente spiegati in altre sezioni. [link] (http://www.thepunctuationguide.com/em-dash.html) – Mousey