Question

need help in json to html conversion

hello all community developers,

what i need i want to convert specifically format json to html:

and format is:

{
      "document": {
        "@pageCount": "1",
        "@pageCountWithOCRPerformed": "0",
        "page": {
          "@index": "0",
          "@OCRWasPerformed": "False",
          "row": [
            {
              "column": [
                {
                  "text": ""
                },
                {
                  "text": ""
                },
                {
                  "text": ""
                },
                {
                  "text": {
                    "@fontName": "Helvetica",
                    "@fontSize": "24.0",
                    "@fontStyle": "Bold",
                    "@color": "#FFFFFF",
                    "@x": "1578.85",
                    "@y": "981.08",
                    "@width": "24.54",
                    "@height": "12.07",
                    "#text": "1"
                  }
                },......

please guide me it is urgent

thanks


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @assh1984,

I recommend using PHP to convert JSON to HTML.

PHP has some built-in functions to handle JSON.

Objects in PHP can be converted into JSON by using the PHP function json_encode(): With that being said, you can decode JSON data into PHP Arrays which will then be parsed to HTML with json_decode();.

Once you do with a foreach loop can loop the data and print it as HTML.