<?php

$string = '&amp;';
$result = htmlentities($string, ENT_QUOTES, 'UTF-8');

var_dump($result);