Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $testCases = array(
- '[1,2,3]',
- '{"one":1,"two":2,"three":3}',
- '"1"',
- '1'
- );
- foreach ($testCases as $testCase) {
- echo "INPUT:", PHP_EOL;
- echo $testCase, PHP_EOL;
- echo "OUTPUT:", PHP_EOL;
- var_dump(json_decode($testCase));
- echo PHP_EOL;
- }
Add Comment
Please, Sign In to add comment