rfc:json_encode_indentation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revisionBoth sides next revision
rfc:json_encode_indentation [2021/06/03 13:49] – created tdgrootrfc:json_encode_indentation [2021/06/03 13:57] tdgroot
Line 4: Line 4:
   * Author: Timon de Groot, tdegroot96@gmail.com   * Author: Timon de Groot, tdegroot96@gmail.com
   * Status: Draft   * Status: Draft
- 
  
 ===== Introduction ===== ===== Introduction =====
Line 22: Line 21:
 ]; ];
  
-echo json_encode($data, JSON_PRETTY_PRINT, 512, 2);+echo json_encode($data, JSON_PRETTY_PRINT, 512, 2) . PHP_EOL; 
 +echo json_encode($data, JSON_PRETTY_PRINT, 512, '🚀🚀') . PHP_EOL;
  
 ?> ?>
Line 36: Line 36:
     3     3
   ]   ]
 +}
 +{
 +🚀"key": 4,
 +🚀"other_key": [
 +🚀🚀0,
 +🚀🚀1,
 +🚀🚀2,
 +🚀🚀3
 +🚀]
 } }
 </code> </code>
rfc/json_encode_indentation.txt · Last modified: 2022/07/19 15:23 by cmb