View Single Post
  #4  
Old 05-03-2017, 11:05 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Bug in returned JSON

In PHP arrays elements may have custom keys:
PHP Code:
array("Color" => "Yellow""Size" => "S"

In JavaScript (JSON comes from there) arrays have no keys, so arrays with keys translate from PHP to JSON as objects:
Code:
{"Color":"Yellow", "Size":"S"}
There is nothing wrong in doing that and you won't get any benefits by wrapping the object into an extra array (that will always contain a single element only).
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote