Skip to content
This repository has been archived by the owner on Aug 7, 2019. It is now read-only.
/ MIJsonParser Public archive

Just like json_encode, simple convert your arrays in valid json string.

License

Notifications You must be signed in to change notification settings

MarioIannotta/MIJsonParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MIJsonParser

MIJsonParser is a simple tool that allow you to convert any type of array in one json string.

Example

Input :

$Students = array(
    array(
        "Name" => "John",
        "Surname" => "Smith",
        "Grades" => array(
            "OOP" => "30",
            "Operating systems" => "28",
            "Mathematics" => array("I" => "27", "II" => "28", "III" => "26"),
            "Books from the library" => array("Advanced OOP", "Vector analysis")
        )
    ),
    array(
        "Name" => "Mike",
        "Surname" => "Taylor",
        "Grades" => array(
            "Electrotechnical" => array("Circuits" => "27", "EMF" => "25"),
            "Chemistry" => "24"
        )
    )
);



require_once 'MIJsonParser.php';
$json = new MIJsonParser;

$json->get($Students);

Output:

{
    "Students": [
        {
            "Name": "John",
            "Surname": "Smith",
            "Grades": {
                "OOP": "30",
                "Operating systems": "28",
                "Mathematics": {
                    "I": "27",
                    "II": "28",
                    "III": "26"
                },
                "Books from the library": [
                    "Advanced OOP",
                    "Vector analysis"
                ]
            }
        },
        {
            "Name": "Mike",
            "Surname": "Taylor",
            "Grades": {
                "Electrotechnical": {
                    "Circuits": "27",
                    "EMF": "25"
                },
                "Chemistry": "24"
            }
        }
    ]
}

About

Just like json_encode, simple convert your arrays in valid json string.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages