PHP » PYTHON |
login |
register |
about
|
PYTHON json_encode
is this article helpful?
|
Python replacement for PHP's json_encode
[
edit
| history
]
# Python 2.6+ import json result = json.dumps(value) # Python 2.6+ import json json.dump(value, out_file) json_encode(PHP 5 >= 5.2.0, PECL json >= 1.2.0) json_encode — Returns the JSON representation of a value DescriptionReturns a string containing the JSON representation of value . Parameters
Return ValuesReturns a JSON encoded string on success. Changelog
Examples
Example #1 A json_encode() example
<?php The above example will output: {"a":1,"b":2,"c":3,"d":4,"e":5}
|
more
Recently updated
more
Most requested
more
Last requests
|