[ create a new paste ] login | about

Link: http://codepad.org/EmWYQFWI    [ raw code | output | fork ]

PHP, pasted on Dec 12:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

$arr = array('text', 0, 'Just some || text in here', 'right');

$json_encoded = json_encode($arr);

echo "Encoded array: $json_encoded\n\n";

$json_decoded = json_decode($json_encoded);

echo "Decoded array:\n";
print_r($json_decoded);

?>


Output:
1
2
3
4
5
6
7
8
9
10
Encoded array: ["text",0,"Just some || text in here","right"]

Decoded array:
Array
(
    [0] => text
    [1] => 0
    [2] => Just some || text in here
    [3] => right
)


Create a new paste based on this one


Comments: