I am developing a web applications where users are allowed to enter some text. To create profile, I am using the text entered by users which is saved in database. Problem is, if the data entered by user contains a comma, it is spoiling my page as a json string can’t contain a comma. Is there any encoding function in php for supporting commas in json.
Note:
Am using zend framework’s zend encoding function to encode json.
Solved:
I got the solution of this problem, json encoding function of zend framework have some issues with encoding decimal data and comma and that was the reason it was creating problem. I used php’s own json encode function.
Did you try json_encode ?
Works well for me:
Gives: