I have a very special case where I have to pass single-quotes through a Form with a Post method. I have found a very ugly solution, but I am curious if anyone has something more elegant. This is what I managed to use:
str_replace("&", "", str_replace("#039;", "'", htmlspecialchars($_POST['Type_' . $i])));
The reason I am going through this conundrum is because I am passing an ENUM query that looks something like this: ENUM(‘DONE’,’NEW’,’PULLED’), and it has to pass exactly under this format (so no slashed quotes either).