bdmovies Posted May 20, 2009 Share Posted May 20, 2009 I'm passing 3 parameters to an ajax controller - 1 of which is JSON. When the controller gets the parameters, it fired the requested method and continues to pass along the parameters (now as 1 parameter, in the form of an array). Once inside the method, the different parameters are extrapolated from the array. However, for some reason I'm having trouble accessing my JSON input. Here's what I've got: JS is sending: ["32", "33", "34", "really any number could go here..."] PHP is receiving: [\"32\", \"33\", etc, etc...] Why (and where) is the PHP parsing the " in the JSON? I'm not scrubbing it until much later in the method. Once I do json_decode($input['chargeID']) I get NULL as a response. Any Ideas? P.S. json_decode($input['chargeID'], true) does not work either. Quote Link to comment https://forums.phpfreaks.com/topic/158940-json-multidimensional-arrays/ Share on other sites More sharing options...
bdmovies Posted May 20, 2009 Author Share Posted May 20, 2009 Ok, scratch that. I know where the \" is coming from, that is being done via JS (Specifically the Prototype framework - .toJSON()) so a new part of my question will be going to the people on the Prototype boards, but I still wonder why does the PHP render NULL upon json_decode()? Quote Link to comment https://forums.phpfreaks.com/topic/158940-json-multidimensional-arrays/#findComment-838276 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.