I have an array, this array fill with values from database, some of the value contains html tags.
I need to echo this array as json format, so I am using json_encode to do that.
The problem is, when I try to replicate json format (because I need the json to be simpler). I can not replicate value which have html tags.
example:
<span style='font-size:12px'> 25 - 35 " </span><p><span style='font-size:12px'> </span>
25 - 35 \" </span> </span>
Thanks
You could try using htmlentities() on each element before building your json string, but i would agree with commenters that you should just create a new array from your old one with only the values you want, then json_encode that.