Skip to content

Instantly share code, notes, and snippets.

Avatar

Timur Kalandarov t1maccapp

View GitHub Profile
@t1maccapp
t1maccapp / json-to-csv.php
Created Oct 26, 2015 — forked from Kostanos/json-to-csv.php
Convert JSON array file to CSV. Use the array keys as the first row. Command line using: json-to-csv.php json.filename > csv.filename
View json-to-csv.php
#!/usr/bin/php
<?php
/*
* Convert JSON file to CSV and output it.
*
* JSON should be an array of objects, dictionaries with simple data structure
* and the same keys in each object.
* The order of keys it took from the first element.
*
* Example:
You can’t perform that action at this time.