So guys im facing a terrible problem that is taking my pacience to solve.
I made a two functions, one to encode data colleted from a wysiwyg editor to send it to a mysql database (the table charset im working with is UTF-8) and other to do the reverse way (Database to wysiwyg), as you can see below.
function displayTextWithTags($textToBeDisplayed) {
return html_entity_decode(html_entity_decode($textToBeDisplayed));
}
function sendTextToDatabase($text){
return trim(htmlentities(htmlentities($text, ENT_QUOTES)));
}
It works very well in my development server, which is running a php 5.4.4, but when i upload my application to the my client's server (running php 5.2.7), the decoding does not work properly...
For example, if i send a &\Eacute;&\eacute;
(I placed a \ so you can read the code) to the database i'll get a Éé
when im retriving it in my development server and a �?é
when im retriving it from the client's server.
I've been lurking stack for hours to find an answer for my problem but i did not succeed, so im begging you for help.