0

I'm looking for a PHP library that I can give a string and a language and get properly formatted code out based on that language.

Example:

$formatter->format('{"name":"bob"}', 'json');

would result in:

{
    "name": "bob"
}

I do know that PHP has json_encode(json_decode($input, true), JSON_PRETTY_PRINT), however I'm looking for support for more languages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.