Show JSON in HTML [closed]

-3

I wanted to ask if you can remove some characters when submitting information from a script , this information will be displayed in Browser . I want to remove ("", {}, -).

    
asked by anonymous 05.03.2018 / 21:15

1 answer

0

Ideally you should convert this json to php object.

using the function json_decode You generate an object and display only the data you want on the screen. = D

<?php

$json = '{"foo-bar": 12345}';

$obj = json_decode($json);
print $obj->{'foo-bar'}; // 12345

?>
    
05.03.2018 / 21:36