php - unable to decode JSON -


i 'm passing json encoded url php generated through flash program

here when trace

myobject=%5b%7b%22fullname%22%3a%22jon%20jay%20junior%22%2c%22role%22%3a%22admin%22%2c%22username%22%3a%22jjj%22%7d%5d 

at php end

$jsonstring = urldecode($_post['myobject']); $jsonstring = str_replace("\\", "", $jsonstring); $data = json_decode($jsonstring); print_r($data); 

but nothing doing wrong here?

code in flash

var people:array = new array(); var person:object = new object(); var url:string = "http://localhost/ping.php"; var request:urlrequest = new urlrequest(url); var requestvars:urlvariables = new urlvariables(); var loader:urlloader = new urlloader(); person.fullname = "jon jay junior"; person.username = "jjj"; person.role = "admin"; people.push(person); request.method = urlrequestmethod.post; requestvars.myobject = json.encode(people); request.data = requestvars; loader.load(request); trace(request.data); 

help!! one?

it's quite possible don't have json extension installed/enabled , php.ini file suppressing errors. if you're using json_decode() other places ignore i'm say.

if you're not sure , want check see if json extension installed pop code snippet new php file , view in browser:

the json extension <?php print ( ! in_array( 'json', get_loaded_extensions( ) ) ) ? 'not' : '' ?> installed , enabled. 

if message "the json extension not installed , enabled.", that's problem is. if word "not" is...well...not in output, isn't problem.

hope helps!


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -