I have a variable in my MySQL database. I want this variable to handle both simple and double quotes.
For example:
$variable = "I'm happy" or $variable = I'm happy or $variable = "I am happy"
In my DB, the first example is this: "i'm happy"
and that works for me. The problem is now on my JS function because I want to call my data:
nameFolder = "<?php echo $variable ; ?>"
But, if $variable = "I'm happy"
, I've got double ""
so I get a JS error. And if I put single quote, the problem is the same with another case.
Any ideas?