Drongo_III Posted January 9, 2015 Share Posted January 9, 2015 Hello This may seem like a silly question but if you never ask you never know... Lets say I json encode a php array. When I echo out the encoded json string into a JS variable it looks something like this in the resultant markup: var arr = ["cow - Copy (10).jpg","cow - Copy (2).jpg"]; So in this instance the string I've echoed out is equivalent to a JS array and I can use it straight away. My questions: 1) Is it valid to do what I've done above? 2) Since I can use the array right away is there any need to JSON.parse? 3) When would you use JSON.parse? Thanks, Drongo Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.