Answers for "json_encode pretty print php"

PHP
7

php JSON_PRETTY_PRINT and ?

header('Content-Type: application/json');


JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES
Posted by: Guest on July-27-2021
1

php json_encode pretty

<?php
header('Content-Type: application/json');

echo json_encode([
    'success' => true,
    'error' => null,
    'data' => [
        'prices' => [
            [
                
                'key' => 0,
                'duration' => 4,
                'price' => 5000,
                ],
                [
                
                'key' => 1,
                'duration' => 6,
                'price' => 7000,
                ],
                [
                
                'key' => 2,
                'duration' => 12,
                'price' => 100000,
                ],
                
                
            ]
        ]
    
    
    ], JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
Posted by: Guest on October-13-2021

Browse Popular Code Answers by Language