Most of these numbers are just ASCII or unicode values I believe, so all you need to do is look up the symbol associated with that value. For non-unicode symbols, this could be as simple as (python script):
#!/usr/bin/python
import sys
# Iterate through all command line arguments
for entity in sys.argv:
# Extract just the digits from the string (discard the '&#' and the ';')
value = "".join([i for i in entity if i in "0123456789"])
# Get the character with that value
result = chr(value)
# Print the result
print result
Then call it with:
python myscript.py "&"
This could presumably be translated to php or something else very easily, something based on:
<?php
$str = "The string ends in ampersand: ";
$str .= chr(38); /* add an ampersand character at the end of $str */
/* Often this is more useful */
$str = sprintf("The string ends in ampersand: %c", 38);
?>
(taken from here as I don't know php!). Of course, this will need modifying to convert "&" into 38, but I'll leave that as an exercise for someone who knows php.