Report this

What is the reason for this report?

need help in json to html conversion

Posted on August 6, 2021

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



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!

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.

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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.