sphule/openemr — comment on commit df7cfcd7fcba9ca91c6fb739a4b4eea23f9671fe
File: library/ajax/addlistitem.php line 45
By yehster:

You should consider using json_encode
http://php.net/manual/en/function.json-encode.php
I think it would be less error prone than concating string and syntactically simpler, especially if you have more than one parameter. It's easy to mess up the quotes and slashes
So this becomes
echo json_encode(array("error"=> xl('Record already exist') );