I have data of questions in mysql DB, lots of which contains single and double quotes. For example:
Which of the following statements create a dictionary?
1. d = {}
2. d = {“john”:40, “peter”:45}
3. d = {40:”john”, 45:”peter”}
4. All of the mentioned
Correct: D
On retrieving data using select statement in php file, this is what I am getting.This is output of print_r
MCQ [questionText] => Which of the following statements create a dictionary? [1] => Which of the following statements create a dictionary? [mcqanswer1] => d = {} [2] => d = {} [mcqanswer2] => d = {�john�:40, �peter�:45} [3] => d = {�john�:40, �peter�:45} [mcqanswer3] => d = {40:�john�, 45:�peter�} [4] => d = {40:�john�, 45:�peter�} [mcqanswer4] => All of the mentioned [5] => All of the mentioned [correctAnswer] => D
Basically it is converting all single and double quotes. Can someone suggest me what do I need to do. Thanks.