Home » » json_encode

json_encode

Written By 1 on Sunday, September 30, 2012 | 9:38 AM

string json_encode ( mixed $value [, int $options = 0 ] )

Returns the JSON representation of a value

Returns a string containing the JSON representation of value.


<?php
$arr 
= array('a' => 1'b' => 2'c' => 3'd' => 4'e' => 5);

echo 
json_encode($arr);
?>

5.4.0 JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, and JSON_UNESCAPED_UNICODE options were added. 5.3.3 JSON_NUMERIC_CHECK option was added. 5.3.0 The options parameter was added.


JSON - PHP y Javascript

0 Comment:

Post a Comment