ultranerds has asked for the wisdom of the Perl Monks concerning the following question:
$return = array( 'status' => '0', 'error' => $error ); echo json_encode($return);
...and:print qq|{ "status": '0', "error": 'foo' }|;
print qq|<response> <status>0</status> <error>foo</error> </response>|;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Convert to JSON, without a module?
by moritz (Cardinal) on Sep 20, 2010 at 10:07 UTC | |
by ultranerds (Hermit) on Sep 20, 2010 at 10:22 UTC | |
|
Re: Convert to JSON, without a module?
by Anonymous Monk on Sep 20, 2010 at 08:43 UTC | |
by ultranerds (Hermit) on Sep 20, 2010 at 08:53 UTC | |
by bobr (Monk) on Sep 20, 2010 at 11:17 UTC | |
|
Re: Convert to JSON, without a module?
by Proclus (Beadle) on Sep 20, 2010 at 15:12 UTC |