I am sorting data alphabetically in PHP from a text file which works perfect, but unfortunately the textfile, which is automatically populated, contains characters like #039; which I want to have removed from the endresult. tried numerous things to replace and remove characters but was not successfull. This is what I have so far : 

```
    <?php
error_reporting(E_ALL);

$fileName = 'cache/_city.txt';
$data     = file_get_contents($fileName);

// Assuming that the file had the data in one line...

// Split the data using the delimiter
$split = explode("|", $data);

// Sort
sort($split);

// Put it all back together
$data = implode("&nbsp", $split);
$data = str_replace("&#039;" , "", $data);

echo $data;

?> 

```

How do I remove this piece of text from $data : #039;

Sample data :

```
<a href="?city=Leiden">Leiden</a>|
<a href="?city=Papendrecht">Papendrecht</a>|
<a href="?city=Helmond">Helmond</a>|
<a href="?city=%26%23039%3Bs-Hertogenbosch">&amp;#039;s-Hertogenbosch</a>|
<a href="?city=Hengelo">Hengelo</a>|
<a href="?city=Marknesse">Marknesse</a>|
<a href="?city=Wanssum">Wanssum</a>|
<a href="?city=Rijswijk">Rijswijk</a>|
<a href="?city=Leunen">Leunen</a>|
<a href="?city=Genemuiden">Genemuiden</a>|

```