eval.in

Paste #5993

PHP — PHP 5.4.6, pasted 1 year ago

1
2
3
4
5
6
<?php

print_r(json_decode('{"book":[{"title":"Good day"}]}'));


echo json_decode('{"book":[{"title":"Good day"}]}')->book[0]->title;

Program Output

stdClass Object
(
    [book] => Array
        (
            [0] => stdClass Object
                (
                    [title] => Good day
                )

        )

)
Good day

OK (0.008 sec real, 0.012 sec wall, 13 MB, 150 syscalls)

Fork