Show JSON in HTML

Asked

Viewed 243 times

-3

I wanted to ask if you can remove some characters when presenting information from a script, this information shall be presented on Browser. I want to remove ( "", {}, - ).

inserir a descrição da imagem aqui

  • Take a look at this question

  • Friend post the code and not the image! Sometimes the tag <pre> can help you... https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre

1 answer

0


ideal is for you to convert this json to php object.

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

<?php

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

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

?>
  • It is a way to do, but would not consider the ideal, it is much simpler and fast to do right in javascript

  • could have sent an example code as it posted nothing I believe it left open.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.