$string = htmlspecialchars($string, ENT_XML1, 'UTF-8');
To Install PHP version 5.4 on Ubuntu, you have to add the right PPA and reinstall your php packages:
sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5-devYou might need to install the add-apt-repository command first:
sudo apt-get install python-software-propertiesThat should do it. Here's to the poor saps trying to write their own XML escape functions for PHP 5.3 and lower.
No comments:
Post a Comment