PHPackages                             raheelarifkhans/json-to-html-converter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. raheelarifkhans/json-to-html-converter

ActiveLibrary[Templating &amp; Views](/categories/templating)

raheelarifkhans/json-to-html-converter
======================================

This PHP function takes a JSON object and converts it into a structured HTML detail page. The function handles nested objects and arrays, displaying them appropriately in a user-friendly format.

03PHP

Since Jun 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/raheelarifkhans/json-to-html-converter)[ Packagist](https://packagist.org/packages/raheelarifkhans/json-to-html-converter)[ RSS](/packages/raheelarifkhans-json-to-html-converter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

JSON to HTML Converter
======================

[](#json-to-html-converter)

This PHP function takes a JSON object and converts it into a structured HTML detail page. The function handles nested objects and arrays, displaying them appropriately in a user-friendly format.

Features
--------

[](#features)

- Converts JSON to HTML
- Handles nested objects and arrays
- Displays boolean values as 'Yes' or 'No'
- Escapes HTML characters for security

Example
-------

[](#example)

### Input JSON

[](#input-json)

```
{
  "name": "Device",
  "domain": "Domain",
  "behaviorBlockerEnabled": true,
  "surfProtectionEnabled": false,
  "fileGuardEnabled": true,
  "protectionStatus": "Offline",
  "fixNowStatus": "Unknown",
  "malwareObjectsCount": 0,
  "settings": {
    "windowsUpdateState": "Undefined",
    "firewallState": {
      "value": "Undefined",
      "original": "Undefined"
    },
    "firewallActualState": "On",
    "rdpState": {
      "value": "On",
      "original": "On"
    },
    "rdpActualState": "On",
    "firewallName": "Windows",
    "networkLockdown": {
      "value": {
        "value": true,
        "original": true
      },
      "enabledOnGroupLevel": true,
      "groupGuid": "7cc8149d-b861-48ee-a0a0-50d19ba030f7",
      "groupName": "New computers"
    },
    "trafficRelay": true,
    "note": "Notes"
  },
  "updateStatus": {
    "lastUpdate": 60,
    "updateStatus": "Updating",
    "updateStatusMessage": "95%",
    "online": "Online"
  },
  "policyEdits": 0,
  "isRelayUsed": false,
  "relayStatus": "Undefined",
  "isProxyUsed": false,
  "protectionPolicyEdits": 0,
  "architecture": "64",
  "cores": 4,
  "browserSecurity": "Chrome",
  "product": "EES",
  "version": "2020.11",
  "updateFeed": "stable",
  "relaySaved": 0,
  "relaySavedUnit": "Kilobytes",
  "criticalEventsCount": 0,
  "disksCount": 0,
  "disks": [
    {
      "letter": "C",
      "total": 2,
      "free": 0
    }
  ],
  "networkAdapters": [
    {
      "name": "Ethernet1",
      "iPv4Addresses": [
        "192.168.0.1"
      ],
      "iPv6Addresses": []
    }
  ]
}
```

### Output HTML

[](#output-html)

```

    Device Details
    Name: Device
    Domain: Domain
    Behavior Blocker Enabled: Yes
    Surf Protection Enabled: No
    File Guard Enabled: Yes
    Protection Status: Offline
    Fix Now Status: Unknown
    Malware Objects Count: 0
    Settings:
    Windows Update State: Undefined
    Firewall State:
    Value: Undefined
    Original: Undefined
    Firewall Actual State: On
    RDP State:
    Value: On
    Original: On
    RDP Actual State: On
    Firewall Name: Windows
    Network Lockdown:
    Value:
    Value: Yes
    Original: Yes
    Enabled On Group Level: Yes
    Group Guid: 7cc8149d-b861-48ee-a0a0-50d19ba030f7
    Group Name: New computers
    Traffic Relay: Yes
    Note: Notes
    Update Status:
    Last Update: 60
    Update Status: Updating
    Update Status Message: 95%
    Online: Online
    Policy Edits: 0
    Is Relay Used: No
    Relay Status: Undefined
    Is Proxy Used: No
    Protection Policy Edits: 0
    Architecture: 64
    Cores: 4
    Browser Security: Chrome
    Product: EES
    Version: 2020.11
    Update Feed: stable
    Relay Saved: 0
    Relay Saved Unit: Kilobytes
    Critical Events Count: 0
    Disks Count: 0
    Disks:

        Letter: C
            Total: 2
            Free: 0

    Network Adapters:

        Name: Ethernet1
            IPv4 Addresses:

                 192.168.0.1

            IPv6 Addresses:

```

### Usage

[](#usage)

#### Installation

[](#installation)

1. You can install the package via Composer. Run the following command:

```
composer require raheelarifkhans/json-to-html-converter

```

2. Include the Composer autoloader in your PHP file:

```
require 'vendor/autoload.php';

```

3. Use the JsonToHtmlConverter class in your code:

```
use RaheelArifKhans\JsonToHtmlConverter;

```

4. Convert your JSON data to HTML using the generateHtmlFromJson function:

```
$json = '{
    "name": "Device",
    "domain": "Domain"
}';
$html = JsonToHtmlConverter::generateHtmlFromJson(json_decode($json, true));

echo $html;

```

### License

[](#license)

This project is licensed under the MIT License - see the LICENSE file for details.

### Contributing

[](#contributing)

1. Fork the repository.
2. Create your feature branch (git checkout -b feature/AmazingFeature).
3. Commit your changes (git commit -m 'Add some AmazingFeature').
4. Push to the branch (git push origin feature/AmazingFeature).
5. Open a Pull Request.

### Contact

[](#contact)

Raheel Khan -

1. Github:
2. LinkedIn:

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab999b2312a921d64cc9cefaa8809e8994bb729b03ec900f0d50404e5bef0691?d=identicon)[raheelarifkhans](/maintainers/raheelarifkhans)

---

Top Contributors

[![raheelarifkhans](https://avatars.githubusercontent.com/u/11134343?v=4)](https://github.com/raheelarifkhans "raheelarifkhans (2 commits)")

### Embed Badge

![Health badge](/badges/raheelarifkhans-json-to-html-converter/health.svg)

```
[![Health](https://phpackages.com/badges/raheelarifkhans-json-to-html-converter/health.svg)](https://phpackages.com/packages/raheelarifkhans-json-to-html-converter)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
